@@ -29,7 +29,7 @@ test('@mdx-js/loader', async () => {
2929
3030 // React.
3131 await promisify ( webpack ) ( {
32- // @ts -expect-error context does not exist on the webpack options types .
32+ // @ts -expect-error To do: webpack types miss support for `context` .
3333 context : fileURLToPath ( base ) ,
3434 entry : './webpack.mdx' ,
3535 mode : 'none' ,
@@ -49,14 +49,13 @@ test('@mdx-js/loader', async () => {
4949 } )
5050
5151 // One for ESM loading CJS, one for webpack.
52- const ContentReact = /** @type {MDXContent } */ (
53- /* @ts -expect-error file is dynamically generated */
54- // type-coverage:ignore-next-line
55- ( await import ( './react.cjs' ) ) . default . default
52+ const modReact = /** @type {{default: {default: MDXContent}} } */ (
53+ // @ts -expect-error file is dynamically generated
54+ await import ( './react.cjs' )
5655 )
5756
5857 assert . equal (
59- renderToStaticMarkup ( React . createElement ( ContentReact ) ) ,
58+ renderToStaticMarkup ( React . createElement ( modReact . default . default ) ) ,
6059 '<h1>Hello, World!</h1>' ,
6160 'should compile (react)'
6261 )
@@ -65,7 +64,7 @@ test('@mdx-js/loader', async () => {
6564
6665 // Preact and source maps
6766 await promisify ( webpack ) ( {
68- // @ts -expect-error context does not exist on the webpack options types .
67+ // @ts -expect-error To do: webpack types miss support for `context` .
6968 context : fileURLToPath ( base ) ,
7069 entry : './webpack.mdx' ,
7170 mode : 'development' ,
@@ -91,14 +90,13 @@ test('@mdx-js/loader', async () => {
9190 } )
9291
9392 // One for ESM loading CJS, one for webpack.
94- const ContentPreact = /** @type {PreactComponent } */ (
95- /* @ts -expect-error file is dynamically generated */
96- // type-coverage:ignore-next-line
97- ( await import ( './preact.cjs' ) ) . default . default
93+ const modPreact = /** @type {{default: {default: PreactComponent}} } */ (
94+ // @ts -expect-error file is dynamically generated.
95+ await import ( './preact.cjs' )
9896 )
9997
10098 assert . equal (
101- render ( h ( ContentPreact , { } ) ) ,
99+ render ( h ( modPreact . default . default , { } ) ) ,
102100 '<h1>Hello, World!</h1>' ,
103101 'should compile (preact)'
104102 )
@@ -113,7 +111,7 @@ test('@mdx-js/loader', async () => {
113111
114112 // Vue.
115113 await promisify ( webpack ) ( {
116- // @ts -expect-error context does not exist on the webpack options types .
114+ // @ts -expect-error To do: webpack types miss support for `context` .
117115 context : fileURLToPath ( base ) ,
118116 entry : './webpack.mdx' ,
119117 mode : 'none' ,
@@ -143,15 +141,14 @@ test('@mdx-js/loader', async () => {
143141 } )
144142
145143 // One for ESM loading CJS, one for webpack.
146- const ContentVue = /** @type {VueComponent } */ (
147- /* @ts -expect-error file is dynamically generated */
148- // type-coverage:ignore-next-line
149- ( await import ( './vue.cjs' ) ) . default . default
144+ const modVue = /** @type {{default: {default: VueComponent}} } */ (
145+ // @ts -expect-error file is dynamically generated
146+ await import ( './vue.cjs' )
150147 )
151148
152149 const vueResult = await serverRenderer . renderToString (
153150 vue . createSSRApp ( {
154- components : { Content : ContentVue } ,
151+ components : { Content : modVue . default . default } ,
155152 template : '<Content />'
156153 } )
157154 )
0 commit comments