@nullcc/unicov
v1.7.0
Published
Transforms coverage into an unify coverage format.
Downloads
55
Readme
unicov
Transforms coverage into an unify coverage format.
Supported coverage reporter types:
- istanbul
- cobertura
- jacoco
- xccov
- clover
- llvm-cov
- auto (unicov will detect coverage type automatically)
Installation
$ npm i @nullcc/unicov
Usage
Parsing single coverage in a specific type coverage:
import { Unicov } from '@nullcc/unicov';
const unicov = await Unicov.fromCoverage('./coverage.json', 'istanbul');
const commonCoverage = unicov.getCoverageData();
// using commonCoverage...
Parsing multi coverages in a specific coverage format:
import { Unicov } from '@nullcc/unicov';
const coverageFiles = [
'./json-coverage1.json',
'./json-coverage2.json',
'./json-coverage3.json'
];
const unicov = await Unicov.fromCoverages(coverageFiles, 'istanbul');
const commonCoverage = unicov.getCoverageData();
// using commonCoverage...
Parsing multi coverages automatically:
import { Unicov } from '@nullcc/unicov';
const coverageFiles = [
'./istanbul-coverage.json',
'./jacoco-empty-cobertura-coverage.xml',
'./cobertura-empty-cobertura-coverage.xml',
'./xccov-empty-cobertura-coverage.xml'
];
const unicov = await Unicov.fromCoverages(coverageFiles, 'auto');
const commonCoverage = unicov.getCoverageData();
// using commonCoverage...
Publish
$ npm publish --access public