Skip to content

Instrument + create reports using istanbul with the mochify stream

License

Notifications You must be signed in to change notification settings

gitter-badger/mochify-istanbul

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mochify-istanbul travis status

Add istanbul coverage to the mochify.js pipeline.

Install

$ npm install mochify mochify-istanbul

Usage

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

va b = mochify('path/to/your/file', mochifyOpts)
  .plugin(istanbul({
    // Intrumenter options
    exclude: ['**/test/**/*', '**/node_modules/**/*']
    // Reporter options
    report: ['text', 'cobertura', 'json'],
    dir: './coverage'
  }))
  .bundle();

Options

There are only two options specific to this module, all the rest options are passed directly to the reporters

  • options.exclude = '<glob pattern>' || ['<glob pattern>']: Files to exclude for the instrumenter. Note that all the exclude pattern should start with '**/' since the mathing is being done against absoulte path for the files.
  • options.report = ['<report type>']: Array of reports to generate. Check istanbul for a updated list of reports

Command line usage

$ mochify --plugin [ mochify-istanbul --exclude '**/+(test|node_modules)/**/*' --report json  \
   --report cobertura --dir ./coverage ] test.js

Compatibility

  • Node >= 0.10
  • v0.x, v1.0, v2.0
    • Mochify 2.x
      • Browserify 6.x
      • Mocha 2.x
      • Istanbul 0.x

Run tests

Clone the repo and run npm install && npm test

License

(The MIT License)

Copyright (c) 2012 Fenando Lores ferlores@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Instrument + create reports using istanbul with the mochify stream

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%