Skip to content

Commit 55e65be

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

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

jest.config.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
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 published package, TS rewrites them to `.js`,
10+
// but then Jest can't find the `.js` files, so this setting needs to be disabled here.
11+
rewriteRelativeImportExtensions: false,
912
},
10-
},
11-
preset: 'ts-jest/presets/js-with-ts',
13+
}),
1214
testEnvironment: 'jsdom',
1315
setupFiles: ['<rootDir>/node_package/tests/jest.setup.js'],
1416
// React Server Components tests are compatible with React 19

0 commit comments

Comments
 (0)