Skip to content

Commit 8893db8

Browse files
wip(tests): new test: "nested mjs import"
1 parent 8282fd4 commit 8893db8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/basic.test.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,37 @@ test('DOM has no scope', async () => {
186186
await page.close();
187187
});
188188

189+
190+
test.only('nested mjs import', async () => {
191+
192+
const { page, output } = await createPage({
193+
files: {
194+
...defaultFiles,
195+
'/component.vue': `
196+
<script>
197+
import { test } from './foo/test.mjs'
198+
console.log( test() );
199+
</script>
200+
`,
201+
202+
'/foo/test.mjs': `
203+
export function test() {
204+
205+
return require('../bar/test.mjs').test();
206+
}
207+
`,
208+
209+
'/bar/test.mjs': `
210+
export function test() {
211+
212+
return 'test_ok';
213+
}
214+
`
215+
}
216+
});
217+
218+
await expect(output.some(e => e.type === 'log' && e.content[0] === 'test_ok' )).toBe(true);
219+
220+
await page.close();
221+
});
222+

0 commit comments

Comments
 (0)