Neptunium, Promethium, Manganese
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

v8-to-istanbul

2.0.2 • Public • Published

v8-to-istanbul

Build Status Conventional Commits Coverage Status

converts from v8 coverage format to istanbul's coverage format.

Usage

const v8toIstanbul = require('v8-to-istanbul')
// create a script object from a source-file. the source file
// is loaded from disk and this is used to determine the original
// line count.
const script = v8toIstanbul('./path-to-instrumented-file.js')
// provide an array of coverage information in v8 format.
script.applyCoverage([
  {
    "functionName": "",
    "ranges": [
      {
        "startOffset": 0,
        "endOffset": 520,
        "count": 1
      }
    ],
    "isBlockCoverage": true
  },
  // ...
])
// output coverage information in a form that can
// be consumed by Istanbul.
console.info(JSON.stringify(script.toIstanbul()))

Testing

To execute tests, simply run:

npm test

To output istanbul coverage data while running tests (useful as you add new assertions), simply run:

DEBUG=true npm test

install

npm i v8-to-istanbul

Downloadsweekly downloads

2,618

version

2.0.2

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability