Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-istanbul-report

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-istanbul-report

write istanbul coverage reports from pre-collected coverage files

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
decreased by-8.99%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-istanbul-report

gulp plugin to create istanbul reports from pre-collected coverage files.

This gulp plugin creates reports using Istanbul from a stream of JSON coverage files (such as those generated by mocha-phantomjs-istanbul).

While gulp-istanbul works well for the basic scenario, operating directly on coverage files provides some flexibility that can come in handy when coverage information is collected elsewhere (e.g. in a browser).

Build Status

Installation

$ npm install gulp-istanbul-report --save-dev

Usage

Here's an example using it together with mocha-phantomjs-istanbul:

var mochaPhantomJS = require('gulp-mocha-phantomjs');
var istanbulReport = require('gulp-istanbul-report');

var coverageFile = './coverage/coverage.json';
var mochaPhantomOpts = {
  phantomjs: {
    hooks: 'mocha-phantomjs-istanbul',
    coverageFile: coverageFile 
  },
};

gulp.task('test', function () {
  gulp.src('test-runner.html', {read: false})
    .pipe(mochaPhantomJS(mochaPhantomOpts))
    .on('finish', function() {
      gulp.src(coverageFile)
        .pipe(istanbulReport())
    });
});

istanbulReport([options])

options.reporters

A list of reporters to use. See require('istanbul').Report.getReportList().

You can specify either just a name of the reporter as string, or an object with the name specified in name, where the other fields are treated as options for the reporter. Example:

istanbulReport({
  reporters: [
    'text-summary', // outputs summary to stdout, uses default options 
    {name: 'text', file: 'full.txt'} // writes full report to file
  ]
})
options.dir

The directory that reports should be written to. Will be applied to all reporters that don't explicitly override it.

options.reporterOpts

Default options to be applied to reporters who don't explicitly override them.

istanbulReport({
  reporterOpts: {
    dir: './coverage'
  },
  reporters: [
    {'name': 'text', file: 'report.txt'}, // -> ./coverage/report.txt
    {'name': 'json', file: 'cov.json', dir: './jsonCov'} // -> ./jsonCov/cov.json
  ]
})

License

MIT License

Keywords

FAQs

Package last updated on 31 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc