browserify-istanbul
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

browserify-istanbul

A browserify transform for the istanbul code coverage tool

3.0.1  •  Updated 2 years ago  •  by Devon Govett  •  MIT License

A browserify transform for the istanbul code coverage tool.

Installing

npm install --save-dev browserify-istanbul

Usage

There are several ways to register browserify transforms: on the command line, in your package.json, or using the browserify API. You can use all of these with browserify-istanbul: see the browserify docs for more info.

There are a few options available to browserify-istanbul when you use it from JavaScript. They are shown in the following code example:

var istanbul = require('browserify-istanbul');

// use without any options...
browserifyBundle.transform(istanbul);

// or with some options...
browserifyBundle.transform(istanbul({
  // ignore these glob paths (the ones shown are the defaults)
  ignore: ['**/node_modules/**', '**/bower_components/**', '**/test/**', '**/tests/**', '**/*.json'],

  // by default, any paths you include in the ignore option are ignored
  // in addition to the defaults. set the defaultIgnore option to false
  // to only ignore the paths you specify.
  defaultIgnore: true
}));

Command line

  • without options:
./node_modules/.bin/browserify -t browserify-istanbul test/test-*.js -o bundle.js
  • with options
./node_modules/.bin/browserify -t [ browserify-istanbul --ignore "**/bower_components/**" ] test/test-*.js -o bundle.js

Interacting With Coverage Reports

To load and manipulate coverage reports, the command line tool nyc can be used:

  1. output the the __coverage__ object to ./.nyc_output/coverage.json.
  1. execute nyc with a list of reporters.
  • nyc report --reporter=lcov --reporter=text-summary.

See istanbul.js.org for more examples and documentation.

License

MIT

Popularity

Weekly Downloads
10.6K
Stars
50

Maintenance

Development

Last ver 2 years ago
Created 6 years ago
Last commit 2 years ago
1 month between commits

Technology

Node version: 6.10.1
0 unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

11 contributors
Devon Govett
Maintainer, 23 commits, 10 merges
Works at Adobe
Alex Indigo
Maintainer, 10 commits, 5 merges, 3 PRs
Ben Drucker
3 commits, 2 PRs
Works at TakeScoop
Peter Mouland
2 commits, 2 PRs
Works at ClearScore
Ziad El Khoury Hanna
2 commits, 3 PRs
Daniel Schmidt
2 commits

Tags

browserify
coverage
istanbul
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.