Skip to content

Commit 2fab741

Browse files
committed
Add test using position not at 1:1
1 parent e3ea95e commit 2fab741

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,32 @@ test('estree-util-build-jsx', (t) => {
14211421
'should support the automatic runtime (no props, no children, development, no locations)'
14221422
)
14231423

1424+
t.deepEqual(
1425+
generate(
1426+
buildJsx(parse('<a>\n <b />\n</a>', false), {
1427+
runtime: 'automatic',
1428+
development: true,
1429+
filePath: 'index.js'
1430+
})
1431+
),
1432+
[
1433+
'import {jsxDEV as _jsxDEV} from "react/jsx-dev-runtime";',
1434+
'_jsxDEV("a", {',
1435+
' children: _jsxDEV("b", {}, void 0, false, {',
1436+
' fileName: "index.js",',
1437+
' lineNumber: 2,',
1438+
' columnNumber: 3',
1439+
' })',
1440+
'}, void 0, false, {',
1441+
' fileName: "index.js",',
1442+
' lineNumber: 1,',
1443+
' columnNumber: 1',
1444+
'});',
1445+
''
1446+
].join('\n'),
1447+
'should support the automatic runtime (no props, nested children, development, positional info)'
1448+
)
1449+
14241450
t.throws(
14251451
() => {
14261452
buildJsx(parse('<a {...b} key/>'), {runtime: 'automatic'})

0 commit comments

Comments
 (0)