Coder Social home page Coder Social logo

coverage-on-diff's Introduction

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

coverage-on-diff's People

Contributors

rayyan98 avatar asmiley-classy avatar tkua-classy01 avatar anashamidkh avatar timothyk7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.