SBoudrias / gulp-istanbul

Istanbul unit test coverage plugin for gulp.
MIT License
186 stars 87 forks source link

Default reporters can't be turned off anymore #102

Closed analog-nico closed 8 years ago

analog-nico commented 8 years ago

Since changing _.defaults to _defaultsDeep in commit https://github.com/SBoudrias/gulp-istanbul/commit/e94f537aee12a422bb0ad816fb42f7e5de59d1fc the default reporters are always turned on.

I just use reporters: ['lcov'] and now all other default reporters like the report in the console are executed as well.

According to the scope of #79 it would be sufficient to just do the _.defaultsDeep on reportOpts:

- opts = _.defaultsDeep(opts, {
+ opts = _.defaults(opts, {
    coverageVariable: COVERAGE_VARIABLE,
    dir: defaultDir,
    reporters: [ 'lcov', 'json', 'text', 'text-summary' ]
+ });
+ opts = _.defaultsDeep(opts, {
    reportOpts: {
      dir: opts.dir || defaultDir
    }
  });
ecozoic commented 8 years ago

Would this issue be what's causing the text-summary reporter to run even when I'm only specifying json?

UPDATE - Using version 1.0.0 has the intended behavior. Upgrading to 1.1.0 has the text/text-summary reporters running even when not specified.

analog-nico commented 8 years ago

@ecozoic Exactly!

SBoudrias commented 8 years ago

Fixed with v1.1.1

analog-nico commented 8 years ago

Works nicely. Thanks!