Skip to content

Commit ad64ade

Browse files
committed
add test for dynamic import
1 parent a9c1bfc commit ad64ade

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`on node ^12.16.0 || >=13.0.0 runs test with native ESM 1`] = `
44
Test Suites: 1 passed, 1 total
5-
Tests: 3 passed, 3 total
5+
Tests: 4 passed, 4 total
66
Snapshots: 0 total
77
Time: <<REPLACED>>
88
Ran all test suites.

e2e/native-esm/__tests__/native-esm.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ test('should support importing node core modules', () => {
3838
type: 'module',
3939
});
4040
});
41+
42+
test('dynamic import should work', async () => {
43+
const {double: importedDouble} = await import('../index');
44+
45+
expect(importedDouble).toBe(double);
46+
expect(importedDouble(1)).toBe(2);
47+
});

0 commit comments

Comments
 (0)