istanbul-combine
Combine coverage reports from multiple runs in to a single coverage report.
var combine = require('istanbul-combine');
var opts = {
dir: 'coverage',
pattern: 'coverage/*-coverage.json',
print: 'summary',
base:'sources',
reporters: {
html: { },
cobertura: { }
}
};
combine(opts, function(err) { });
combine(opts).then( );
combine.sync(opts);
command line
npm install -g istanbul-combine
istanbul-combine -d coverage -p summary -r lcov -r html coverage/coverage-a.json coverage/coverage-b.json /coverage/*.json
usage: istanbul-combine [options] patterns
where patterns
is any number of file glob-patterns separated by whitespace
options:
-d
: output directory for the report(s). Defaults to coverage
-p
: what to print to the console. summary
| detail
| both
| none
. Defaults to summary
.-r
: a reporter. lcov
, html
, etc. You can specify multiple reporters by using this tag multiple times.-b
: base directory resolving relative paths to absolute ones. Fixes a bug with where karma reports relative file paths.
karma bug
You will need to use the base
or -b
option if you intend to combine reports generated using karma-coverage
with
reports generated using other tools (i.e. tests not run in the browser).
See this pull request.