File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change
1
+ import { createJsWithTsPreset } from 'ts-jest' ;
2
+
1
3
const nodeVersion = parseInt ( process . version . slice ( 1 ) , 10 ) ;
2
4
3
5
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 ,
9
13
} ,
10
- } ,
11
- preset : 'ts-jest/presets/js-with-ts' ,
14
+ } ) ,
12
15
testEnvironment : 'jsdom' ,
13
16
setupFiles : [ '<rootDir>/node_package/tests/jest.setup.js' ] ,
14
17
// React Server Components tests are compatible with React 19
You can’t perform that action at this time.
0 commit comments