@@ -152,7 +152,7 @@ import Demo from './demo'
152152 assert . equal (
153153 error . message ,
154154 `Build failed with 1 error:
155- __mdx_bundler_fake_dir__/ _mdx_bundler_entry_point.mdx:3:17: error: Could not resolve "./demo"`,
155+ _mdx_bundler_entry_point.mdx:3:17: error: Could not resolve "./demo"` ,
156156 )
157157} )
158158
@@ -174,7 +174,7 @@ import Demo from './demo'
174174 assert . equal (
175175 error . message ,
176176 `Build failed with 1 error:
177- __mdx_bundler_fake_dir__/ demo.tsx:1:7: error: Could not resolve "./blah-blah"`,
177+ demo.tsx:1:7: error: Could not resolve "./blah-blah"` ,
178178 )
179179} )
180180
@@ -196,7 +196,7 @@ import Demo from './demo.blah'
196196 assert . equal (
197197 error . message ,
198198 `Build failed with 1 error:
199- __mdx_bundler_fake_dir__/ _mdx_bundler_entry_point.mdx:3:17: error: [plugin: inMemory] Invalid loader: "blah" (valid: js, jsx, ts, tsx, css, json, text, base64, dataurl, file, binary)`,
199+ _mdx_bundler_entry_point.mdx:3:17: error: [plugin: inMemory] Invalid loader: "blah" (valid: js, jsx, ts, tsx, css, json, text, base64, dataurl, file, binary)` ,
200200 )
201201} )
202202
@@ -301,15 +301,15 @@ test('require from current directory', async () => {
301301 const mdxSource = `
302302# Title
303303
304- import {Sample} from './other/ sample-component'
304+ import {Sample} from './sample-component'
305305
306306<Sample />
307307
308- 
308+ 
309309` . trim ( )
310310
311311 const { code} = await bundleMDX ( mdxSource , {
312- cwd : process . cwd ( ) ,
312+ cwd : path . join ( process . cwd ( ) , 'other' ) ,
313313 xdmOptions : options => {
314314 options . remarkPlugins = [ remarkMdxImages ]
315315
@@ -343,11 +343,11 @@ test('should output assets', async () => {
343343 const mdxSource = `
344344# Sample Post
345345
346- 
346+ 
347347 ` . trim ( )
348348
349349 const { code} = await bundleMDX ( mdxSource , {
350- cwd : process . cwd ( ) ,
350+ cwd : path . join ( process . cwd ( ) , 'other' ) ,
351351 xdmOptions : options => {
352352 options . remarkPlugins = [ remarkMdxImages ]
353353
@@ -374,7 +374,7 @@ test('should output assets', async () => {
374374
375375 const error = /** @type Error */ (
376376 await bundleMDX ( mdxSource , {
377- cwd : process . cwd ( ) ,
377+ cwd : path . join ( process . cwd ( ) , 'other' ) ,
378378 xdmOptions : options => {
379379 options . remarkPlugins = [ remarkMdxImages ]
380380
@@ -452,7 +452,7 @@ import Demo from './demo'
452452
453453<Demo />
454454 ` . trim ( )
455-
455+
456456 const result = await bundleMDX ( mdxSource , {
457457 files : {
458458 './demo.tsx' : `
@@ -466,13 +466,15 @@ function Demo() {
466466}
467467
468468export default Demo
469- ` . trim ( )
470- }
469+ ` . trim ( ) ,
470+ } ,
471471 } )
472472
473473 const Component = getMDXComponent ( result . code )
474474
475- const { container} = render ( React . createElement ( Component ) , { container : document . body } )
475+ const { container} = render ( React . createElement ( Component ) , {
476+ container : document . body ,
477+ } )
476478
477479 assert . match ( container . innerHTML , 'Portal!' )
478480} )
0 commit comments