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. Run Code Coverage from CLI
  • 2. View Coverage Folder
  1. Impact Features

Code Coverage Report

PreviousFast ModeNextDelete Recorded Requests

Last updated 7 months ago

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 :

    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.

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.

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

  • Once you open your file, you will able to see the lines we have not covered marked in pink.

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