Skip to content

Commit

Permalink
Merge pull request #11 from plumlee/master
Browse files Browse the repository at this point in the history
Allow passing in a config object to be handed to the Instrumenter
  • Loading branch information
devongovett committed Feb 3, 2015
2 parents 0b9cab4 + 9345bab commit ed57c87
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var through = require('through');
var minimatch = require('minimatch');
var path = require('path');

var instrumenter = new istanbul.Instrumenter();
var defaultIgnore = ['**/node_modules/**', '**/test/**', '**/tests/**', '**/*.json'];

module.exports = function(options, extraOptions) {
Expand All @@ -15,7 +14,13 @@ module.exports = function(options, extraOptions) {

if (ignore.some(minimatch.bind(null, file)))
return through();


var instrumenterConfig = {};
if (options.instrumenterConfig &&
typeof options.instrumenterConfig === 'object')
instrumenterConfig = options.instrumenterConfig;
var instrumenter = new istanbul.Instrumenter(instrumenterConfig);

var data = '';
return through(function(buf) {
data += buf;
Expand Down

0 comments on commit ed57c87

Please sign in to comment.