How to add a coverage report in Angular Project

angular coverage test Tutorials

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:

  "codeCoverage": true
comments powered by Disqus