Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rayyan98/coverage-on-diff

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rayyan98/coverage-on-diff

A tool to get code coverage on new lines added based on a diff

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.1K
decreased by-18.7%
Maintainers
1
Weekly downloads
 
Created
Source

Coverage On Diff

Continuation of coverage-on-diff

A tool that uses an instanbul json code coverage report and git diff to calculate the code coverage on new lines added

Installation:

npm i coverage-on-diff --save-dev

Usage:

terminal > ./coverageOnDiff --help
Run diff against current code coverage
Usage: cli.js -d [file]

Options:
  --version       Show version number                                  [boolean]
  --diff, -d      diff file to compare code coverage to           [string] [required]
  --coverage, -c  instanbul json code coverage report to use against diff
                            [string] [default: "./coverage/coverage-final.json"]
  --path, -p      relative root dir for code coverage
                      [string] [default: "./"]
  --report, -r    type of report
             [array] [choices: "text", "text-summary"] [default: "text-summary"]
  --stmt, -s      percentage threshold for stmt coverage  [number] [default: 80]
  --branch, -b    percentage threshold for branch coverage [number] [default: 0]
  --ignore, -i    ignore threshold checks                              [boolean]
  --help          Show help                                            [boolean]

Reports

The final report will look similar to below:

text-summary view

./coverageOnDiff -d ~/dev/branch.diff

image of terminal 1

text view

./coverageOnDiff -d ~/dev/branch.diff -r text

image of terminal 2

Threshold test will run by default with 80% statement coverage and 0% branch coverage

Keywords

FAQs

Package last updated on 29 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc