Skip to content

Commit 60fa3f0

Browse files
committed
Switch to fully undeprecated ts-jest config
1 parent 69a59fa commit 60fa3f0

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

jest.config.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
import { createJsWithTsPreset } from 'ts-jest';
2+
13
const nodeVersion = parseInt(process.version.slice(1), 10);
24

35
export default {
4-
globals: {
5-
'ts-jest': {
6-
tsconfig: {
7-
rewriteRelativeImportExtensions: false,
8-
},
6+
...createJsWithTsPreset({
7+
tsconfig: {
8+
// Relative imports in our TS code include `.ts` extensions.
9+
// When compiling the package, TS rewrites them to `.js`,
10+
// but ts-jest runs on the original code where the `.js` files don't exist,
11+
// so this setting needs to be disabled here.
12+
rewriteRelativeImportExtensions: false,
913
},
10-
},
11-
preset: 'ts-jest/presets/js-with-ts',
14+
}),
1215
testEnvironment: 'jsdom',
1316
setupFiles: ['<rootDir>/node_package/tests/jest.setup.js'],
1417
// React Server Components tests are compatible with React 19

0 commit comments

Comments
 (0)