byzantine

istanbul coverage json parser

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
byzantine
111.1.07 years ago7 years agoMinified + gzip package size for byzantine in KB

Readme

Byzantine
Istanbul json coverage parser

Install

Byzantine expects node 6
yarn add byzantine
# or
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');

// 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