# Updating test coverage

{% hint style="warning" %}
Make sure you go through the steps to add nyc to your project [here](/user-guides/node.js-sdk/code-coverage-based-features.md) before this.
{% endhint %}

Hypertest allows you to update coverage of the tests that have so far been recorded. This is run using a cli command. Running this will spawn your application instance, hit all the test cases recorded so far and store the code coverage generated.

{% hint style="warning" %}
Make sure that you checkout to your master (Or the branch that is your baseline for recording requests) and have no local changes before you run this command. We want to store the lines covered on master.
{% endhint %}

1. Create ht cli config file. This is the same that is used to run cli test.
2. Your app will be spawned using the command you give in the cli config. Make sure you run your app using nyc in that command. (Don't run the cli process with nyc, just your app)

Example

```json
// App's package.json
{
    "scripts" : {
        "start-app-with-nyc" : "nyc --nycrc-path <nyc-config-file> <your app start command>"
    }, 
}
```

3. Change the `appStartCommand` and `appStartCommandArgs` ( inside your cli config ) to the what you created in step 2.

Example:&#x20;

```json
{
  /*
    Rest of your cli config...
  */
  appStartCommand: 'npm',
  appStartCommandArgs: ['run', 'start-app-with-nyc'],
}
```

4. Please complete the CLI token generation as mentioned [here](/user-guides/node.js-sdk/cli-login.md).
5. Run the cli command to update coverage

```bash
htcli update-coverage --config-file-path <path-to-your-cli-config>
```


---

# 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-v2.hypertest.co/user-guides/node.js-sdk/code-coverage-based-features/updating-test-coverage.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.
