-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@angular/cli): allow code coverage excludes #4966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d2cd8a7
to
f5ef871
Compare
@@ -21,13 +22,25 @@ export function getTestConfig(testConfig: WebpackTestOptions) { | |||
const extraRules: any[] = []; | |||
|
|||
if (testConfig.codeCoverage) { | |||
const codeCoverageConfig = CliConfig.fromProject().config.test.codeCoverage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
test
allows you to list exclude globs for code coverage:/cc @delasteve