diff --git a/packages/jest-cli/src/test_scheduler.js b/packages/jest-cli/src/test_scheduler.js index 036eadc919ac..59fab9b4fffe 100644 --- a/packages/jest-cli/src/test_scheduler.js +++ b/packages/jest-cli/src/test_scheduler.js @@ -227,10 +227,10 @@ export default class TestScheduler { const isDefault = this._shouldAddDefaultReporters(reporters); if (isDefault) { - this._setupDefaultReporters(); + this._setupDefaultReporters(collectCoverage); } - if (collectCoverage) { + if (!isDefault && collectCoverage) { this.addReporter(new CoverageReporter(this._globalConfig)); } @@ -245,13 +245,17 @@ export default class TestScheduler { } } - _setupDefaultReporters() { + _setupDefaultReporters(collectCoverage: boolean) { this.addReporter( this._globalConfig.verbose ? new VerboseReporter(this._globalConfig) : new DefaultReporter(this._globalConfig), ); + if (collectCoverage) { + this.addReporter(new CoverageReporter(this._globalConfig)); + } + this.addReporter(new SummaryReporter(this._globalConfig)); }