Repository navigation
feat(@angular/cli): allow code coverage excludes - #4966
Conversation
d2cd8a7 to
f5ef871
Compare
| const extraRules: any[] = []; | ||
|
|
||
| if (testConfig.codeCoverage) { | ||
| const codeCoverageConfig = CliConfig.fromProject().config.test.codeCoverage; |
There was a problem hiding this comment.
fromProject() can return null, and test and codeCoverage might be missing from the config. Use get() to allow for defaults.
f5ef871 to
672b9a3
Compare
A new CLI config entry under `test` allows you to list exclude globs for code coverage:
```
"test": {
"codeCoverage": {
"exclude": [
"src/polyfills.ts",
"**/test.ts"
]
},
"karma": {
"config": "./karma.conf.js"
}
},
```
672b9a3 to
754114e
Compare
A new CLI config entry under `test` allows you to list exclude globs for code coverage:
```
"test": {
"codeCoverage": {
"exclude": [
"src/polyfills.ts",
"**/test.ts"
]
},
"karma": {
"config": "./karma.conf.js"
}
},
```
|
Am I correct in thinking that this is no longer possible with the latest version 6.0.0 of angular-cli? I've tried adding a Is something like this available with 6.0.0, and if so how should it be used? |
|
@pete-otaqui this should work on 6.0: |
|
Thanks for that - I actually managed to work that out by searching the repo for "codeCoverageExclude", working out where from the angular.json schema that key was allowed and went form there. Thanks again for the example |
|
It would be nice too if the documentation can be updated to align with the changes that @filipesilva mentioned. Currently it only mentioned that it expects the name of the test entry-point file. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
A new CLI config entry under
testallows you to list exclude globs for code coverage:/cc @delasteve