'I am missing code coverage when I run npm test --code-coverage
I am using an Angular 6 application. When I run the command ng test --code-coverage I get info if my tests are successful or failed but I don't get printed that in percentage like I should - so for example functions coverage is 80% etc.
After I run this command I can find the coverage folder in my application and I know if I open index.html I will get the percentages there, but I need to have this feature "live" so when i make changes the ng test command will re-run. I can't open index.html on every change I make.
My angular.json file - test property:
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
I tried explicitly adding "codeCoverage": true in my angular.json configuration but it still does not print the percentages in my terminal.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
