Skip to content

Commit

Permalink
Allow passing deep options to the instrumenter. Fix #79
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Aug 14, 2016
1 parent d93e057 commit e94f537
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/
coverage/
cov-foo/
json/
lcovonly/
*.orig
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,13 @@ plugin.writeReports = function (opts) {
opts = opts || {};

var defaultDir = path.join(process.cwd(), 'coverage');
opts = _.defaults(opts, {
opts = _.defaultsDeep(opts, {
coverageVariable: COVERAGE_VARIABLE,
dir: defaultDir,
reporters: [ 'lcov', 'json', 'text', 'text-summary' ],
reportOpts: { dir: opts.dir || defaultDir }
reportOpts: {
dir: opts.dir || defaultDir
}
});

var reporters = opts.reporters.map(function(reporter) {
Expand Down

0 comments on commit e94f537

Please sign in to comment.