Skip to content

Commit

Permalink
actually run test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 2, 2023
1 parent d707724 commit d7e7422
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
12 changes: 10 additions & 2 deletions e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`does not enforce import assertions 1`] = `
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-missing-import-assertions.test/i."
Ran all test suites matching /native-esm-missing-import-assertions.test.js/i."
`;
exports[`on node >=16.9.0 support re-exports from CJS of dual packages 1`] = `
Expand All @@ -21,7 +21,15 @@ exports[`on node >=16.12.0 supports import assertions 1`] = `
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-import-assertions.test/i."
Ran all test suites matching /native-esm-import-assertions.test.js/i."
`;
exports[`properly handle re-exported native modules in ESM via CJS 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-native-module.test.js/i."
`;
exports[`runs WebAssembly (Wasm) test with native ESM 1`] = `
Expand Down
20 changes: 17 additions & 3 deletions e2e/__tests__/nativeEsm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,21 @@ test('runs WebAssembly (Wasm) test with native ESM', () => {
test('does not enforce import assertions', () => {
const {exitCode, stderr, stdout} = runJest(
DIR,
['native-esm-missing-import-assertions.test'],
['native-esm-missing-import-assertions.test.js'],
{nodeOptions: '--experimental-vm-modules --no-warnings'},
);

const {summary} = extractSummary(stderr);

expect(summary).toMatchSnapshot();
expect(stdout).toBe('');
expect(exitCode).toBe(0);
});

test('properly handle re-exported native modules in ESM via CJS', () => {
const {exitCode, stderr, stdout} = runJest(
DIR,
['native-esm-native-module.test.js'],
{nodeOptions: '--experimental-vm-modules --no-warnings'},
);

Expand All @@ -113,7 +127,7 @@ onNodeVersions('>=16.12.0', () => {
test('supports import assertions', () => {
const {exitCode, stderr, stdout} = runJest(
DIR,
['native-esm-import-assertions.test'],
['native-esm-import-assertions.test.js'],
{nodeOptions: '--experimental-vm-modules --no-warnings'},
);

Expand All @@ -129,7 +143,7 @@ onNodeVersions('<16.12.0', () => {
test('syntax error for import assertions', () => {
const {exitCode, stderr, stdout} = runJest(
DIR,
['native-esm-import-assertions.test'],
['native-esm-import-assertions.test.js'],
{nodeOptions: '--experimental-vm-modules --no-warnings'},
);

Expand Down

0 comments on commit d7e7422

Please sign in to comment.