Skip to content

Commit

Permalink
add test for dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Apr 12, 2020
1 parent a9c1bfc commit ad64ade
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`on node ^12.16.0 || >=13.0.0 runs test with native ESM 1`] = `
Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
Tests: 4 passed, 4 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Expand Down
7 changes: 7 additions & 0 deletions e2e/native-esm/__tests__/native-esm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ test('should support importing node core modules', () => {
type: 'module',
});
});

test('dynamic import should work', async () => {
const {double: importedDouble} = await import('../index');

expect(importedDouble).toBe(double);
expect(importedDouble(1)).toBe(2);
});

0 comments on commit ad64ade

Please sign in to comment.