Skip to content

Commit c83c0cb

Browse files
Fix jest config
1 parent 74b2dad commit c83c0cb

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

jest.config.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
22

3-
const runNatively = !!process.features.typescript;
3+
const nativeESM = !!process.features.typescript;
44

5-
module.exports = {
6-
runner: runNatively ? 'jest-light-runner' : undefined,
5+
const config = {
76
preset: 'ts-jest/presets/default-esm',
87
testEnvironment: 'node',
98
moduleDirectories: ['node_modules', 'src'],
@@ -13,7 +12,13 @@ module.exports = {
1312
diagnostics: {
1413
ignoreCodes: [151001],
1514
},
16-
useESM: runNatively,
15+
useESM: nativeESM,
1716
},
1817
},
1918
};
19+
20+
if (nativeESM) {
21+
config.runner = 'jest-light-runner';
22+
}
23+
24+
module.exports = config;

0 commit comments

Comments
 (0)