Webstorm Jest runner changes tsconfig.json on disk

When I run jest tests from webstorm for a typescript project, it removes my @root path map in my tsconfig and fails all tests

Before:
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"preserveConstEnums": true,
"downlevelIteration": true,
"removeComments": true,
"sourceMap": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"baseUrl": "src",
"paths": {
"@root/*": ["./*"],
},
"allowUnreachableCode": false,
"allowUnusedLabels": false
},
"include": [
"src"
],
"exclude": [
"**/*.spec.ts",
"swagger-codegen"
]
}

after:

{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"preserveConstEnums": true,
"downlevelIteration": true,
"removeComments": true,
"sourceMap": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"baseUrl": "src",
"allowUnreachableCode": false,
"allowUnusedLabels": false
},
"include": [
"src"
],
"exclude": [
"**/*.spec.ts",
"swagger-codegen"
]
}



0
1 comment

I can tell for sure that WebStorm test runner doesn't touch tsconfig.json files

Could you share a test project the issue can be repeated with?

0

Please sign in to leave a comment.