Skip to content

Commit c9c299d

Browse files
committed
make ts-jest transform JS files
1 parent 79676ea commit c9c299d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/utils/jest.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
module.exports = require('../../jest/jest.config.js');
1+
const baseConfig = require('../../jest/jest.config.js');
2+
3+
module.exports = {
4+
...baseConfig,
5+
transform: {
6+
'^.+\\.ts$': 'ts-jest',
7+
'^.+\\.js$': 'ts-jest',
8+
},
9+
};

packages/utils/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
"compilerOptions": {
77
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8-
"types": ["node", "jest"]
8+
"types": ["node", "jest"],
99

1010
// other package-specific, test-specific options
11+
// this is necessary in order to be able to handle the buildPolyfills `originals.js` which is used for testing
12+
"allowJs": true
1113
}
1214
}

0 commit comments

Comments
 (0)