@@ -8,29 +8,50 @@ const doc = String(
88 await fs . readFile ( new URL ( '../test/jsx.jsx' , import . meta. url ) )
99)
1010
11- await fs . writeFile (
12- new URL ( '../test/ jsx- build-jsx-classic.js' , import . meta . url ) ,
13- toJs (
14- buildJsx (
15- fromJs ( doc . replace ( / ' n a m e ' / , "'jsx (estree-util-build-jsx, classic)'" ) , {
16- plugins : [ acornJsx ( ) ] ,
17- module : true
18- } ) ,
19- { pragma : 'h' , pragmaFrag : 'null' }
20- )
21- ) . value
11+ const treeAutomatic = fromJs (
12+ doc . replace ( / ' n a m e ' / , "' jsx (estree-util- build-jsx, automatic)'" ) ,
13+ { plugins : [ acornJsx ( ) ] , module : true }
14+ )
15+
16+ const treeAutomaticDevelopment = fromJs (
17+ doc . replace (
18+ / ' n a m e ' / ,
19+ "'jsx (estree-util-build-jsx, automatic, development)'"
20+ ) ,
21+ { plugins : [ acornJsx ( ) ] , module : true }
2222)
2323
24+ const treeClassic = fromJs (
25+ doc . replace ( / ' n a m e ' / , "'jsx (estree-util-build-jsx, classic)'" ) ,
26+ {
27+ plugins : [ acornJsx ( ) ] ,
28+ module : true
29+ }
30+ )
31+
32+ buildJsx ( treeAutomatic , {
33+ runtime : 'automatic' ,
34+ importSource : 'hastscript'
35+ } )
36+ buildJsx ( treeAutomaticDevelopment , {
37+ runtime : 'automatic' ,
38+ importSource : 'hastscript' ,
39+ development : true
40+ } )
41+ buildJsx ( treeClassic , { pragma : 'h' , pragmaFrag : 'null' } )
42+
2443await fs . writeFile (
2544 new URL ( '../test/jsx-build-jsx-automatic.js' , import . meta. url ) ,
45+ toJs ( treeAutomatic ) . value
46+ )
47+
48+ await fs . writeFile (
49+ new URL ( '../test/jsx-build-jsx-automatic-development.js' , import . meta. url ) ,
50+ // There’s a problem with `this` that TS doesn’t like.
51+ '// @ts-nocheck\n\n' + toJs ( treeAutomaticDevelopment ) . value
52+ )
2653
27- toJs (
28- buildJsx (
29- fromJs (
30- doc . replace ( / ' n a m e ' / , "'jsx (estree-util-build-jsx, automatic)'" ) ,
31- { plugins : [ acornJsx ( ) ] , module : true }
32- ) ,
33- { runtime : 'automatic' , importSource : 'hastscript' }
34- )
35- ) . value
54+ await fs . writeFile (
55+ new URL ( '../test/jsx-build-jsx-classic.js' , import . meta. url ) ,
56+ toJs ( treeClassic ) . value
3657)
0 commit comments