File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-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 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 ,
9
12
} ,
10
- } ,
11
- preset : 'ts-jest/presets/js-with-ts' ,
13
+ } ) ,
12
14
testEnvironment : 'jsdom' ,
13
15
setupFiles : [ '<rootDir>/node_package/tests/jest.setup.js' ] ,
14
16
// React Server Components tests are compatible with React 19
You can’t perform that action at this time.
0 commit comments