From 18ed282ec1e1853e13eec9a4874421ade5d7d21b Mon Sep 17 00:00:00 2001 From: Carlos Hernando Carasol Date: Thu, 25 Aug 2016 16:01:14 +0200 Subject: [PATCH] Fix override default reporters (#101) --- index.js | 2 +- test/main.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 02b74e5..2531975 100644 --- a/index.js +++ b/index.js @@ -124,11 +124,11 @@ plugin.writeReports = function (opts) { opts = _.defaultsDeep(opts, { coverageVariable: COVERAGE_VARIABLE, dir: defaultDir, - reporters: [ 'lcov', 'json', 'text', 'text-summary' ], reportOpts: { dir: opts.dir || defaultDir } }); + opts.reporters = opts.reporters || [ 'lcov', 'json', 'text', 'text-summary' ]; var reporters = opts.reporters.map(function(reporter) { if (reporter.TYPE) Report.register(reporter); diff --git a/test/main.js b/test/main.js index 62ce565..efb3a89 100644 --- a/test/main.js +++ b/test/main.js @@ -291,6 +291,7 @@ describe('gulp-istanbul', function () { process.stdout.write = out; assert(fs.existsSync('./cov-foo')); assert(!fs.existsSync('./cov-foo/lcov.info')); + assert(!fs.existsSync('./cov-foo/coverage-final.json')); assert(fs.existsSync('./cov-foo/cobertura-coverage.xml')); process.stdout.write = out; done();