diff --git a/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap b/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap index c1b2cee1867c..625baf4f126f 100644 --- a/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap +++ b/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap @@ -5,7 +5,7 @@ exports[`does not enforce import assertions 1`] = ` Tests: 2 passed, 2 total Snapshots: 0 total Time: <> -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`] = ` @@ -21,7 +21,15 @@ exports[`on node >=16.12.0 supports import assertions 1`] = ` Tests: 2 passed, 2 total Snapshots: 0 total Time: <> -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: <> +Ran all test suites matching /native-esm-native-module.test.js/i." `; exports[`runs WebAssembly (Wasm) test with native ESM 1`] = ` diff --git a/e2e/__tests__/nativeEsm.test.ts b/e2e/__tests__/nativeEsm.test.ts index d31b46ac7c1c..29af40ccbd65 100644 --- a/e2e/__tests__/nativeEsm.test.ts +++ b/e2e/__tests__/nativeEsm.test.ts @@ -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'}, ); @@ -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'}, ); @@ -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'}, );