@@ -145,10 +145,10 @@ test('compile', async () => {
145145 'should support the automatic runtime (`@jsxRuntime`)'
146146 )
147147
148- console . log (
149- '\nnote: the next deprecation is expected (preact is missing an export map)\n'
150- )
151-
148+ // console.log(
149+ // '\nnote: the next deprecation is expected (preact is missing an export map)\n'
150+ // )
151+ //
152152 // To do: re-enable when `preact/compat` has a correct export map.
153153 // assert.equal(
154154 // render(
@@ -178,12 +178,7 @@ test('compile', async () => {
178178
179179 assert . equal (
180180 render (
181- h (
182- await run ( compileSync ( '<>1</>' , { jsxImportSource : 'preact' } ) , {
183- keepImport : true
184- } ) ,
185- { }
186- )
181+ h ( await run ( compileSync ( '<>1</>' , { jsxImportSource : 'preact' } ) ) , { } )
187182 ) ,
188183 '1' ,
189184 'should support `jsxImportSource` for `preact`'
@@ -198,8 +193,7 @@ test('compile', async () => {
198193 ) . replace (
199194 / \/ j s x - r u n t i m e (? = [ " ' ] ) / g,
200195 '$&/dist/emotion-react-jsx-runtime.cjs.prod.js'
201- ) ,
202- { keepImport : true }
196+ )
203197 )
204198 )
205199 ) ,
@@ -947,7 +941,7 @@ test('markdown (GFM, with `remark-gfm`)', async () => {
947941 await run ( compileSync ( '* [x] a\n* [ ] b' , { remarkPlugins : [ remarkGfm ] } ) )
948942 )
949943 ) ,
950- '<ul class="contains-task-list">\n<li class="task-list-item"><input type="checkbox" checked ="" disabled =""/> a</li>\n<li class="task-list-item"><input type="checkbox" disabled=""/> b</li>\n</ul>' ,
944+ '<ul class="contains-task-list">\n<li class="task-list-item"><input type="checkbox" disabled ="" checked =""/> a</li>\n<li class="task-list-item"><input type="checkbox" disabled=""/> b</li>\n</ul>' ,
951945 'should support task lists (`* [x]` -> `input`)'
952946 )
953947
@@ -1322,10 +1316,7 @@ test('source maps', async () => {
13221316 Buffer . from ( JSON . stringify ( file . map ) ) . toString ( 'base64' ) +
13231317 '\n'
13241318
1325- await fs . writeFile (
1326- path . join ( base , 'sourcemap.js' ) ,
1327- String ( file ) . replace ( / \/ j s x - r u n t i m e (? = [ " ' ] ) / g, '$&.js' )
1328- )
1319+ await fs . writeFile ( path . join ( base , 'sourcemap.js' ) , String ( file ) )
13291320
13301321 const Content = /** @type {MDXContent } */ (
13311322 /* @ts -expect-error file is dynamically generated */
@@ -1356,32 +1347,21 @@ test.run()
13561347/**
13571348 *
13581349 * @param {VFileCompatible } input
1359- * @param {{keepImport?: boolean} } [options]
13601350 * @return {Promise<MDXContent> }
13611351 */
1362- async function run ( input , options = { } ) {
1363- return ( await runWhole ( input , options ) ) . default
1352+ async function run ( input ) {
1353+ return ( await runWhole ( input ) ) . default
13641354}
13651355
13661356/**
13671357 *
13681358 * @param {VFileCompatible } input
1369- * @param {{keepImport?: boolean} } [options]
13701359 * @return {Promise<MDXModule> }
13711360 */
1372- async function runWhole ( input , options = { } ) {
1361+ async function runWhole ( input ) {
13731362 const name = 'fixture-' + nanoid ( ) . toLowerCase ( ) + '.js'
13741363 const fp = path . join ( 'test' , 'context' , name )
1375- let doc = String ( input )
1376-
1377- // Extensionless imports only work in faux-ESM (webpack and such),
1378- // *not* in Node by default: *except* if there’s an export map defined
1379- // in `package.json`.
1380- // React doesn’t have one yet (it’s on `master` but not yet released), so add
1381- // the extension for ’em:
1382- if ( ! options . keepImport ) {
1383- doc = doc . replace ( / \/ j s x - r u n t i m e (? = [ " ' ] ) / g, '$&.js' )
1384- }
1364+ const doc = String ( input )
13851365
13861366 await fs . writeFile ( fp , doc )
13871367
0 commit comments