> For the complete documentation index, see [llms.txt](https://docs.gapvelocity.ai/webmap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gapvelocity.ai/webmap/general/frontend/documentation/winforms-angular-components/setup/unit-test-manual.md).

# Unit Test Manual

## Create a new Unit Test

Our unit tests for every web component are based in the Angular's unit testing standard using the JEST runner.

## How to run existing unit tests

To execute the existing unit tests use the `npm run test` command using the command line terminal. &#x20;

![](/files/-MG9ZBjOo6PaBjQbm-KM)

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:

```
ng test --watch=false --code-coverage
```

The coverage report is generated in a folder called `coverage` in the root of the WebComponents project: &#x20;

<div align="left"><img src="/files/-MG9ZMtrhA-6diq6aZYj" alt=""></div>

You can see the generated report opening the `index.html` file that is inside the `coverage` folder: &#x20;

![](/files/-MG9ZVJnOnsXOPIwxHoW)

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.

{% hint style="info" %}
If you want more info about how to create a unit test and the best practices, you can consult our documentation ([Frontend Unit Testing](https://docs.mobilize.net/quality-process-documentation/-MdOocvpdZXjVDQHlaPZ/description-1/unit-test/frontend-unit-testing)).
{% endhint %}
