@@ -98,11 +98,11 @@ test('@mdx-js/mdx: evaluate', async function (t) {
9898 } )
9999
100100 await t . test (
101- 'should support an `import` of a relative url w/ `useDynamicImport `' ,
101+ 'should support an `import` of a relative url w/ `baseUrl `' ,
102102 async function ( ) {
103103 const mod = await evaluate (
104104 'import {number} from "./context/data.js"\n\n{number}' ,
105- { baseUrl : import . meta. url , useDynamicImport : true , ...runtime }
105+ { baseUrl : import . meta. url , ...runtime }
106106 )
107107
108108 assert . equal (
@@ -113,13 +113,13 @@ test('@mdx-js/mdx: evaluate', async function (t) {
113113 )
114114
115115 await t . test (
116- 'should support an `import` of a full url w/ `useDynamicImport `' ,
116+ 'should support an `import` of a full url w/ `baseUrl `' ,
117117 async function ( ) {
118118 const mod = await evaluate (
119119 'import {number} from "' +
120120 new URL ( 'context/data.js' , import . meta. url ) +
121121 '"\n\n{number}' ,
122- { baseUrl : import . meta. url , useDynamicImport : true , ...runtime }
122+ { baseUrl : import . meta. url , ...runtime }
123123 )
124124
125125 assert . equal (
@@ -130,41 +130,33 @@ test('@mdx-js/mdx: evaluate', async function (t) {
130130 )
131131
132132 await t . test (
133- 'should support an `import` w/o specifiers w/ `useDynamicImport `' ,
133+ 'should support an `import` w/o specifiers w/o `baseUrl `' ,
134134 async function ( ) {
135135 assert . match (
136- String (
137- await compile ( 'import "a"' , {
138- outputFormat : 'function-body' ,
139- useDynamicImport : true
140- } )
141- ) ,
136+ String ( await compile ( 'import "a"' , { outputFormat : 'function-body' } ) ) ,
142137 / \n a w a i t i m p o r t \( " a " \) ; ? \n /
143138 )
144139 }
145140 )
146141
147142 await t . test (
148- 'should support an `import` w/ 0 specifiers w/ `useDynamicImport `' ,
143+ 'should support an `import` w/ 0 specifiers w/o `baseUrl `' ,
149144 async function ( ) {
150145 assert . match (
151146 String (
152- await compile ( 'import {} from "a"' , {
153- outputFormat : 'function-body' ,
154- useDynamicImport : true
155- } )
147+ await compile ( 'import {} from "a"' , { outputFormat : 'function-body' } )
156148 ) ,
157149 / \n a w a i t i m p o r t \( " a " \) ; ? \n /
158150 )
159151 }
160152 )
161153
162154 await t . test (
163- 'should support a namespace import w/ `useDynamicImport `' ,
155+ 'should support a namespace import w/ `baseUrl `' ,
164156 async function ( ) {
165157 const mod = await evaluate (
166158 'import * as x from "./context/components.js"\n\n<x.Pill>Hi!</x.Pill>' ,
167- { baseUrl : import . meta. url , useDynamicImport : true , ...runtime }
159+ { baseUrl : import . meta. url , ...runtime }
168160 )
169161
170162 assert . equal (
@@ -175,11 +167,11 @@ test('@mdx-js/mdx: evaluate', async function (t) {
175167 )
176168
177169 await t . test (
178- 'should support a namespace import and a bare specifier w/ `useDynamicImport `' ,
170+ 'should support a namespace import and a bare specifier w/ `baseUrl `' ,
179171 async function ( ) {
180172 const mod = await evaluate (
181173 'import Div, * as x from "./context/components.js"\n\n<x.Pill>a</x.Pill> and <Div>b</Div>' ,
182- { baseUrl : import . meta. url , useDynamicImport : true , ...runtime }
174+ { baseUrl : import . meta. url , ...runtime }
183175 )
184176
185177 assert . equal (
@@ -247,81 +239,56 @@ test('@mdx-js/mdx: evaluate', async function (t) {
247239 )
248240 } )
249241
250- await t . test ( 'should throw on an `export * from`' , async function ( ) {
251- try {
252- await evaluate ( 'export {a} from "b"' , runtime )
253- assert . fail ( )
254- } catch ( error ) {
255- assert . match (
256- String ( error ) ,
257- / U n e x p e c t e d ` i m p o r t ` o r ` e x p o r t … f r o m ` i n ` e v a l u a t e ` \( o u t p u t t i n g a f u n c t i o n b o d y \) b y d e f a u l t /
258- )
259- }
260- } )
261-
262242 await t . test (
263- 'should support an `export from` w/ `useDynamicImport `' ,
243+ 'should support an `export from` w/ `baseUrl `' ,
264244 async function ( ) {
265245 const mod = await evaluate ( 'export {number} from "./context/data.js"' , {
266246 baseUrl : import . meta. url ,
267- useDynamicImport : true ,
268247 ...runtime
269248 } )
270249
271250 assert . equal ( mod . number , 3.14 )
272251 }
273252 )
274253
275- await t . test (
276- 'should support an `export` w/ `useDynamicImport`' ,
277- async function ( ) {
278- const mod = await evaluate (
279- 'import {number} from "./context/data.js"\nexport {number}' ,
280- { baseUrl : import . meta. url , useDynamicImport : true , ...runtime }
281- )
254+ await t . test ( 'should support an `export` w/ `baseUrl`' , async function ( ) {
255+ const mod = await evaluate (
256+ 'import {number} from "./context/data.js"\nexport {number}' ,
257+ { baseUrl : import . meta. url , ...runtime }
258+ )
282259
283- assert . equal ( mod . number , 3.14 )
284- }
285- )
260+ assert . equal ( mod . number , 3.14 )
261+ } )
286262
287263 await t . test (
288- 'should support an `export as from` w/ `useDynamicImport `' ,
264+ 'should support an `export as from` w/ `baseUrl `' ,
289265 async function ( ) {
290266 const mod = await evaluate (
291267 'export {number as data} from "./context/data.js"' ,
292- {
293- baseUrl : import . meta. url ,
294- useDynamicImport : true ,
295- ...runtime
296- }
268+ { baseUrl : import . meta. url , ...runtime }
297269 )
298270
299271 assert . equal ( mod . data , 3.14 )
300272 }
301273 )
302274
303275 await t . test (
304- 'should support an `export default as from` w/ `useDynamicImport `' ,
276+ 'should support an `export default as from` w/ `baseUrl `' ,
305277 async function ( ) {
306278 const mod = await evaluate (
307279 'export {default as data} from "./context/data.js"' ,
308- {
309- baseUrl : import . meta. url ,
310- useDynamicImport : true ,
311- ...runtime
312- }
280+ { baseUrl : import . meta. url , ...runtime }
313281 )
314282
315283 assert . equal ( mod . data , 6.28 )
316284 }
317285 )
318286
319287 await t . test (
320- 'should support an `export all from` w/ `useDynamicImport `' ,
288+ 'should support an `export all from` w/ `baseUrl `' ,
321289 async function ( ) {
322290 const mod = await evaluate ( 'export * from "./context/data.js"' , {
323291 baseUrl : import . meta. url ,
324- useDynamicImport : true ,
325292 ...runtime
326293 } )
327294
@@ -333,11 +300,11 @@ test('@mdx-js/mdx: evaluate', async function (t) {
333300 )
334301
335302 await t . test (
336- 'should support an `export all from`, but prefer explicit exports, w/ `useDynamicImport `' ,
303+ 'should support an `export * from`, but prefer explicit exports, w/ `baseUrl `' ,
337304 async function ( ) {
338305 const mod = await evaluate (
339306 'export {default as number} from "./context/data.js"\nexport * from "./context/data.js"' ,
340- { baseUrl : import . meta. url , useDynamicImport : true , ...runtime }
307+ { baseUrl : import . meta. url , ...runtime }
341308 )
342309
343310 // I’m not sure if this makes sense, but it is how Node works.
@@ -372,42 +339,6 @@ test('@mdx-js/mdx: evaluate', async function (t) {
372339 }
373340 )
374341
375- await t . test ( 'should throw on an export all from' , async function ( ) {
376- try {
377- await evaluate ( 'export * from "a"' , runtime )
378- assert . fail ( )
379- } catch ( error ) {
380- assert . match (
381- String ( error ) ,
382- / U n e x p e c t e d ` i m p o r t ` o r ` e x p o r t … f r o m ` i n ` e v a l u a t e ` \( o u t p u t t i n g a f u n c t i o n b o d y \) b y d e f a u l t /
383- )
384- }
385- } )
386-
387- await t . test ( 'should throw on an import' , async function ( ) {
388- try {
389- await evaluate ( 'import {a} from "b"' , runtime )
390- assert . fail ( )
391- } catch ( error ) {
392- assert . match (
393- String ( error ) ,
394- / U n e x p e c t e d ` i m p o r t ` o r ` e x p o r t … f r o m ` i n ` e v a l u a t e ` \( o u t p u t t i n g a f u n c t i o n b o d y \) b y d e f a u l t /
395- )
396- }
397- } )
398-
399- await t . test ( 'should throw on an import default' , async function ( ) {
400- try {
401- await evaluate ( 'import a from "b"' , runtime )
402- assert . fail ( )
403- } catch ( error ) {
404- assert . match (
405- String ( error ) ,
406- / U n e x p e c t e d ` i m p o r t ` o r ` e x p o r t … f r o m ` i n ` e v a l u a t e ` \( o u t p u t t i n g a f u n c t i o n b o d y \) b y d e f a u l t : /
407- )
408- }
409- } )
410-
411342 await t . test ( 'should support a given components' , async function ( ) {
412343 const mod = await evaluate ( '<X/>' , runtime )
413344
0 commit comments