-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix jest and cypress global type definitions clashing in IntelliJ
- Loading branch information
1 parent
22d2d06
commit c9e2827
Showing
2 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* To learn more about this file see: https://angular.io/config/tsconfig. */ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./out-tsc/spec", | ||
"module": "CommonJs", | ||
"skipLibCheck": true, | ||
"emitDecoratorMetadata": true | ||
}, | ||
"files": [ | ||
"polyfills.ts" | ||
], | ||
"include": [ | ||
"**/*.spec.ts", | ||
], | ||
"exclude": [ | ||
// This is to prevent global types clashing between jest and cypress | ||
// See: https://github.com/cypress-io/cypress/issues/22059#issuecomment-1148921141 | ||
"../cypress.config.ts", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
/* To learn more about this file see: https://angular.io/config/tsconfig. */ | ||
/* Having the real tsconfig.spec.json under src is a workaround, as in IntelliJ, | ||
* the *.spec.ts files would otherwise be compiled with tsconfig.app.json, | ||
* which would lead to a clash of global types for tests that both cypress and jest define. | ||
* | ||
* See: | ||
* - https://stackoverflow.com/questions/58999086/cypress-causing-type-errors-in-jest-assertions/72663546#72663546 | ||
* - https://youtrack.jetbrains.com/issue/WEB-43373/IntelliJ-not-correctly-interpreting-standard-ng-cli-tsconfig-setup | ||
*/ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./out-tsc/spec", | ||
"module": "CommonJs", | ||
"types": ["jest"], | ||
"skipLibCheck": true, | ||
"emitDecoratorMetadata": true | ||
}, | ||
"files": ["src/polyfills.ts"], | ||
"include": [ | ||
"src/**/*.spec.ts", | ||
"src/**/*.d.ts", | ||
"../node_modules/@types/jest" | ||
] | ||
"extends": "./src/tsconfig.spec.json" | ||
} |