Byzantine
Istanbul json coverage parser
Install
Byzantine expects node 6
yarn add byzantine
npm install byzantine --save
Usage
Byzantine has 2 module: parse
and aggregate
:
const parse = require('byzantine');
const aggregate = require('byzantine/aggregate');
const json = require('./coverage/coverage-final.json');
const coverages = parse(json);
const { statements, branches, functions } = aggregate(coverages);
The main module (byzantine
) returns array of simplified coverage information.
type Coverage {
path: String
statements: CoverageData
branches: CoverageData
functions: CoverageData
}
type CoverageData {
covered: Int
all: Int
}
aggregate
returns percentage of coverage for each category in Float
, or null
for empty array
type CoverageAggregate {
statements: ?Float
branches: ?Float
functions: ?Float
}
License
MIT