Détail du package

@atakama/cover-diff

AtakamaLLC207ISC1.2.3

coverage reporter and enforcer for diffs only

coverage, diffs, diff

readme

Build Status codecov

cover-diff

Report & enforce diff coverage on diffs only.

Install:

npm install @atakama/cover-diff

Use:

Pipe in diffs, get an lcov file out.

git diff origin/master | cover-diff > diff-cover.lcov
genhtml diff-cover.lcov -o diff-cover

Note:

If you don't have genhtml, do this:

curl -O https://raw.githubusercontent.com/linux-test-project/lcov/master/bin/genhtml
chmod +x genhtml
./genhtml diff-cover.lcov -o diff-cover

That works in most bashifed environments (including Windows under git bash).

Options:

Options are located in the package.json for your project. The default lcov path is the same as the istanbul default output path.

"@atakama/cover-diff" : {
    "lines" : 80,
    "branches" : 70,
    "functions" : 100,
    "lcovFile" : "coverage/lcov.info",
    "diffFile" : \<stdin\>,
    "stripRoot" : [<project-home-dir>],
}

Notes:

  • Empty or invali diff : exit with an error, no stdout.
  • Valid diff, but no lines in the diff match: no error exit, no stdout

Changelog

changelog

Changelog

[1.2.3]:

Changed

  • genhtml doesn't deal with things well, make it easy to detect a valid empty lcov

[1.2.2]:

Changed

  • valid empty lcov

[1.2.1]:

Fixed

  • branch summary correct

[1.2.0]:

Changed

  • strip package.json container path from all paths in diff/lcov
  • option stripRoot is a string or array to override

[1.1.3]:

Fixed

  • reports more than 1 file correctly
  • cli paths not weird

[1.1.0]:

Changed

  • normalize paths for windows
  • enforcement options work

[1.0.2]:

Fixed

  • cli runnable

[1.0.1]:

Package

  • specify files

[0.1.0]:

Initial commit

  • setup ci/cd