Combine multiple coverage reports into a single merged one
npm i -D create-merged-coverage-reports
First, configure your testing framework to output either json
, or, if you are running tests on multiple machines, relative-paths-istanbul-json-report
, coverage reports
Then, merge your coverage reports using either the CLI, or the API
$ npx create-merged-coverage-reports@latest --help
Usage: create-merged-coverage-reports [options]
Create merged coverage reports
Options:
-v, --version output the version number
-c, --coverageFileGlob <glob> Glob to get all json coverage files
-o, --outputDirectory <dir> Directory where all merged coverage reports
-r, --reporters <reporters...> Which reporters (either built-in, or custom) to use to generate the merged coverage
reports
-h, --help display help for command
import { createMergedCoverageReports } from 'create-merged-coverage-reports';
async function main() {
await createMergedCoverageReports();
}
main();
Run nx build create-merged-coverage-reports
to build the library.
Run nx test create-merged-coverage-reports
to execute the unit tests.
MIT © Aliaksandr Haurusiou.