> For the complete documentation index, see [llms.txt](https://docs-v2.hypertest.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-v2.hypertest.co/impact-features/code-coverage-report.md).

# Code Coverage Report

In simple words, code coverage is a white-box testing method that shows the percentage of code that gets executed during test runs. It aids us in evaluating the extent to which our tests address the code and identify any potential gaps.

With HyperTest, you can achieve over 90% code coverage. When you run your tests through the HyperTest CLI, it generates a comprehensive code coverage report, clearly highlighting which code paths are covered and which ones need more attention.

## **1. Run Code Coverage from CLI**

* Go to your Visual Code Studio
* Run the command :&#x20;

  ```json
  run-test-cov-html
  ```
* After this, a coverage folder will be generated and a code coverage report will be displayedon your CLI along with the test result. This will give you a general idea on how many statements, branches, functions and lines are covered when your test ran.

&#x20;

<figure><img src="/files/rhY5ZJbsJSZ1bODKXskW" alt=""><figcaption></figcaption></figure>

## 2. View Coverage Folder

You can open this report on your browser to get a more granular view of how many lines have been covered by your code.

Go to the coverage folder and open the file *.htConf.js.html* in your browser.

* Click on 'All Files' to view all of your code.

<figure><img src="/files/xKxqJMPA0gCKON0rj9fU" alt=""><figcaption></figcaption></figure>

* Open the file whose code coverage you want to take a look into.

<figure><img src="/files/H5huGR6BNJLWlcWc2Tnf" alt=""><figcaption></figcaption></figure>

* Once you open your file, you will able to see the lines we have not covered marked in pink.&#x20;

  <figure><img src="/files/F4YuQwviea1Azf0hdFwS" alt=""><figcaption></figcaption></figure>

For the lines marked in pink, we just need some traffic and we will be able to cover these scenarios instantly.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs-v2.hypertest.co/impact-features/code-coverage-report.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
