Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "byzantine", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "istanbul coverage json parser", | ||
@@ -28,3 +28,6 @@ "main": "index.js", | ||
}, | ||
"homepage": "https://github.com/pveyes/byzantine#readme" | ||
"homepage": "https://github.com/pveyes/byzantine#readme", | ||
"devDependencies": { | ||
"jest": "^21.2.1" | ||
} | ||
} |
# Byzantine | ||
> Istanbul json coverage parser | ||
## Install | ||
Byzantine expects node 6 | ||
```sh | ||
yarn add byzantine | ||
# or | ||
npm install byzantine --save | ||
``` | ||
## Usage | ||
Byzantine has 2 module: `parse` and `aggregate`: | ||
```js | ||
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. | ||
```js | ||
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 | ||
```js | ||
type CoverageAggregate { | ||
statements: ?Float | ||
branches: ?Float | ||
functions: ?Float | ||
} | ||
``` | ||
## License | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90297
8
187
59
1