byzantine
v1.1.0
Published
istanbul coverage json parser
Downloads
16
Maintainers
Readme
Byzantine
Istanbul json coverage parser
Install
Byzantine expects node 6
yarn add byzantine
# or
npm install byzantine --saveUsage
Byzantine has 2 module: parse and aggregate:
const parse = require('byzantine');
const aggregate = require('byzantine/aggregate');
const json = require('./coverage/coverage-final.json');
// returns Array<Coverage>
const coverages = parse(json);
// returns CoverageAggregate
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
