# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gapvelocity.ai/webmap/general/frontend/documentation/winforms-angular-components/setup/unit-test-manual.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
