How to add a coverage report in Angular Project


angular coverage test Tutorials

Hello! If you are from Ukraine, Belarus, Poland or India and looking for a job in Software Development, please reach me out by email.

If you want to enable coverage report you can change your test script to the following:

ng test --code-coverage

or this:

ng test --code-coverage=true

Just run npm run test and it will generate a /coverage directory after finishing.

Another way to generate coverage reports it’s to enable it in angular.json:

"test":{
  "options":{
  "codeCoverage": true
  }
}
comments powered by Disqus