Angular CLI code coverage and deployment in prod mode.
Last updated
Last updated
The CLI can run unit tests and create code coverage reports. Code coverage reports show you any parts of your code base that may not be properly tested by your unit tests.
To generate a coverage report run the following command in the root of your project.
When the tests are complete, the command creates a new /coverage
folder in the project. Open the index.html
file to see a report with your source code and code coverage values.
If you want to create code-coverage reports every time you test, you can set the following option in the CLI configuration file, angular.json
:
Once we have run our command we should be able to see:
Then we need to install globally the following:
then we need to cd coverage
folder and run the server
Now we should be able to check the port 8080