Skip to content

Commit 05b5724

Browse files
committed
Update tests for changes in Babel
1 parent 033518a commit 05b5724

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* @typedef {import('estree').Program} Program
3-
* @typedef {import('estree').Comment} Comment
43
* @typedef {import('estree').Node} Node
54
* @typedef {import('hast').Root} Root
65
* @typedef {import('hast').Content} Content
@@ -918,9 +917,9 @@ test('integration (@babel/plugin-transform-react-jsx, react)', (t) => {
918917
t.deepEqual(
919918
transform('# Hi <Icon /> {"!"}', {runtime: 'automatic'}),
920919
[
920+
'import { Fragment as _Fragment } from "react/jsx-runtime";',
921921
'import { jsx as _jsx } from "react/jsx-runtime";',
922922
'import { jsxs as _jsxs } from "react/jsx-runtime";',
923-
'import { Fragment as _Fragment } from "react/jsx-runtime";',
924923
'/*#__PURE__*/_jsx(_Fragment, {',
925924
' children: /*#__PURE__*/_jsxs("h1", {',
926925
' children: ["Hi ", /*#__PURE__*/_jsx(Icon, {}), " ", "!"]',
@@ -932,7 +931,7 @@ test('integration (@babel/plugin-transform-react-jsx, react)', (t) => {
932931

933932
t.deepEqual(
934933
transform('# Hi <Icon /> {"!"}', {pragma: 'a', pragmaFrag: 'b'}),
935-
'a(b, null, a("h1", null, "Hi ", a(Icon, null), " ", "!"));',
934+
'a("b", null, a("h1", null, "Hi ", a(Icon, null), " ", "!"));',
936935
'should integrate w/ `@babel/plugin-transform-react-jsx` (pragma, pragmaFrag)'
937936
)
938937

@@ -943,9 +942,9 @@ test('integration (@babel/plugin-transform-react-jsx, react)', (t) => {
943942
),
944943
[
945944
'import /* a */a from "b";',
945+
'import { Fragment as _Fragment } from "react/jsx-runtime";',
946946
'import { jsx as _jsx } from "react/jsx-runtime";',
947947
'import { jsxs as _jsxs } from "react/jsx-runtime";',
948-
'import { Fragment as _Fragment } from "react/jsx-runtime";',
949948
'/*#__PURE__*/_jsx(_Fragment, {',
950949
' children: /*#__PURE__*/_jsxs("h1", {',
951950
' children: [" ", /*#__PURE__*/_jsx("x", {',

0 commit comments

Comments
 (0)