Skip to content

Commit 1093df8

Browse files
committed
Add 'experimental-specifier-resolution' flag to NPM options in ESM module override test
1 parent f8cbc42 commit 1093df8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/test/index.spec.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,14 @@ test.suite('ts-node', (test) => {
18911891

18921892
test('moduleTypes can override module type to CJS in an ESM loader project', async () => {
18931893
const { err, stderr, stdout } = await exec(
1894-
`${cmd} ./module-types/test.esm.js`
1894+
// TODO: Is the experimental-specified-resolution flag required here, or is there a better approach?
1895+
`${cmd} ./module-types/test.esm.js`,
1896+
{
1897+
env: {
1898+
...process.env,
1899+
NODE_OPTIONS: `--experimental-specifier-resolution=node`,
1900+
},
1901+
}
18951902
);
18961903
expect(err).to.equal(null);
18971904
});

0 commit comments

Comments
 (0)