newFileCoverageThreshold
, defaults to coverageThreshold
if not passedimport fs from 'fs';
import { diff as coverageDiff } from 'coverage-diff';
const base = JSON.parse(fs.readFileSync('./base-summary.json'));
const head = JSON.parse(fs.readFileSync('./head-summary.json'));
const diff = coverageDiff.diff(base, head);
console.log(diff.diff);
console.log(diff.results);
console.log(diff.regression);
Out:
Ok | File | Lines | Branches | Functions | Statements |
---|---|---|---|---|---|
🔴 | file1 | 80% (+10%) |
14% (-30%) |
3% (+20%) |
20% (-10%) |
✅ | file2 | 20% (+10%) |
8% (-30%) |
2% (-20%) |
5% (-10%) |
Generated using TypeDoc