> 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/user-guides/node.js-sdk/code-coverage-based-features/updating-test-coverage.md).

# 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>
```
