When generating a project using Angular CLI, the following ‘tsconfig’ files are generated which all extend tsconfig.json
:
– ‘src/tsconfig.app.json’ to run the application with ng serve
– ‘src/tsconfig.spec.json’ to run unit tests with ng test
– ‘e2e/tsconfig.e2e.json’ to run end-to-end tests with ng e2e
In .angular-cli.json
those files are referenced as following:
{
...
"apps": [
{
...
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json", // ignored by Angular IDE
}
],
...
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
...
}
It seems that Angular IDE ignores this setup and uses tsconfig.app.json
only. Because tsconfig.app.json
specifies to exclude all *.spec.ts
files, those files are excluded from being compiled in Angular IDE and therefore not checked for compilation errors. This applies for unit as well as for e2e test files.
-
This topic was modified 8 years, 4 months ago by
Daniel.