Unit Test Manual
Last updated
Last updated
Our unit tests for every web component are based in the Angular's unit testing standard using the JEST runner.
To execute the existing unit tests use the npm run test
command using the command line terminal.
If you want to see the coverage report for unit test use the npm run test
command. It is configured to run the ng test
command using some flags that generates the coverage report. Also you can manually run ng test
using:
The coverage report is generated in a folder called coverage
in the root of the WebComponents project:
You can see the generated report opening the index.html
file that is inside the coverage
folder:
Currently there is a coverage threshold of 90%, therefore the build process will fail if you try to commit a component with less unit tests coverage.
If you want more info about how to create a unit test and the best practices, you can consult our documentation (Frontend Unit Testing).