Hypertest v2 Docs
HyperTest
  • Overview
    • How It Works?
  • SETUP GUIDE
    • Installation
      • Deploy HyperTest Server
      • Creating your first User
      • Adding your first service
      • Integrate SDK
        • Node.js
          • Node.js SDK with CJS
          • Node.js SDK with ESM
        • Java
    • Start a Test Run
      • CLI Login
      • Type References
      • Java
  • Interpreting Test Results
    • Test Results
    • Understanding Results Categories
    • Mock Not Found
    • AI Match Mocks
    • Accepting Changes
  • USER GUIDES
    • Node.js SDK
      • Limit memory usage
      • Supported NPM packages
      • Mock Dependencies Manually
      • Unmocking/Passing Through
      • Sampling and blocking requests
      • Manage Global Variables
      • Mocking Environment Variables
      • Tags
      • Set HTTP path patterns
      • Discard a test case(Request) while recording
      • Set Git Commit Hash
      • Code coverage based features
        • Continuous Coverage
        • Updating test coverage
        • Running post test deduplication
        • Only testing modified requests
        • Ignore differences for unmodified requests
      • Experimental flags
      • Manual Request
      • Only testing modified requests
      • Server hooks
    • Java SDK
      • Sampling and blocking requests
      • Mock Dependencies Manually
      • Tags
      • Unmocking/Passing Through
      • Code Coverage Setup and Report Generation
      • Supported Java packages
    • Build your own Docker Image
    • CLI Config
    • Ignoring Differences
      • Type References for Filter functions
  • Impact Features
    • Fast Mode
    • Code Coverage Report
    • Delete Recorded Requests
    • Inter Service Testing
  • Release History
    • Slack Integration
    • Version History
Powered by GitBook
On this page
  1. USER GUIDES
  2. Node.js SDK
  3. Code coverage based features

Continuous Coverage

How to measure Continuous Coverage?

PreviousCode coverage based featuresNextUpdating test coverage

Last updated 1 month ago

Continuous Coverage helps you measure the coverage of requests made to your application in real time. Once you start your app, Hypertest will begin tracking coverage from the beginning.

This feature supports two modes:

  • RECORD

  • DISABLED

Make sure you go through the steps to add nyc to your project before this.

Steps to Measure Continuous Coverage

Follow these steps to enable and measure Continuous Coverage using Hypertest:

Make Sure you set the when measuring continuous coverage. It helps in accurately mapping the coverage data to the correct code version.

Step 1: Configure Continuous Coverage in Your App

Add the following code snippet to your app's index.js file:

// App's index.js
htSdk.measureContinuousCoverage({
  backendBaseUrl: '<your-hypertest-backend-url>',
  htExtraHeaders: {},
  buildId: '',
  serviceId: '<your-service-identifier-from-dashboard>',
  refreshIntervalInSec: 60 // Default interval is 60 seconds
});

Step 2: Access the Hypertest Dashboard

  1. Navigate to the Hypertest Dashboard.

  2. Select your service and go to the Continuous Coverage page.

  3. Click on the Measure Continuous Coverage button to start tracking.

Example:

Step 3: Start Your App with NYC

Update the start command in your package.json to run your app with NYC:

// App's package.json
{
  "scripts": {
    "start": "nyc <your app start command>"
  }
}

Step 4: View Real-Time Coverage

Once the app is running, Hypertest will update the coverage data automatically at intervals defined by refreshIntervalInSec (default: 60 seconds).

You can monitor the results on the Hypertest Dashboard.

here
Git Commit Hash