Setting Up Your Angular CLI App to Generate Code Coverage Reports Any Time Tests Are Run in a Workspace with Multiple Projects
I currently do development in an Angular CLI application that contains multiple library projects, and recently enabled code coverage reports to be generated automatically every time unit tests were run. This consisted of 4 steps: Turn on code coverage for each project. Exclude the libraries from coverage in projects that utilized them (each library has its own coverage). Set the output directory for each project's code coverage report to a sub-directory of the code coverage directory to avoid overwriting files for each report generated. Make additions to ignore the code coverage directory from source control. Here's each of these steps in detail. Step 1: Turn on code coverage for each project In angular.json , go to the architect/test/options node for each project and add a property called codeCoverage if it's not already there. Set the value to true , as shown below: "test" : { "builder" : "@angular-devkit/build-angular: