Skip to content

Commit ca32c89

Browse files
committed
feat(config/jest): use ts-jest automatically if tsconfig.json is found
1 parent bd06190 commit ca32c89

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/config/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const jestConfig = {
4747
globals: {},
4848
}
4949

50-
if (hasAnyDep('ts-jest')) {
50+
if (hasAnyDep('ts-jest') || hasFile('tsconfig.json')) {
5151
jestConfig.preset = 'ts-jest/presets/js-with-ts'
5252
jestConfig.globals['ts-jest'] = {
5353
diagnostics: {

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "./dist/config/tsconfig"
2+
"extends": "./dist/config/tsconfig",
3+
"compilerOptions": {
4+
"allowJs": true
5+
}
36
}

0 commit comments

Comments
 (0)