diff --git a/packages/core/src/reporters/MutationTestReportHelper.ts b/packages/core/src/reporters/MutationTestReportHelper.ts index fcb93911b9..f7eb74b618 100644 --- a/packages/core/src/reporters/MutationTestReportHelper.ts +++ b/packages/core/src/reporters/MutationTestReportHelper.ts @@ -57,8 +57,8 @@ export class MutationTestReportHelper { public reportAll(results: MutantResult[]) { const report = this.mutationTestReport(results); - this.reporter.onMutationTestReportReady(report); this.reporter.onAllMutantsTested(results); + this.reporter.onMutationTestReportReady(report); this.determineExitCode(report); } diff --git a/packages/core/test/unit/reporters/MutationTestReportHelper.spec.ts b/packages/core/test/unit/reporters/MutationTestReportHelper.spec.ts index 16b3b19c65..155cfe832e 100644 --- a/packages/core/test/unit/reporters/MutationTestReportHelper.spec.ts +++ b/packages/core/test/unit/reporters/MutationTestReportHelper.spec.ts @@ -51,6 +51,16 @@ describe(MutationTestReportHelper.name, () => { expect(reporterMock.onMutationTestReportReady).calledOnce; }); + it('should report "onAllMutantsTested"', () => { + sut.reportAll([]); + expect(reporterMock.onAllMutantsTested).calledOnce; + }); + + it('should report "onAllMutantsTested" before mutationTestReportReady', () => { + sut.reportAll([]); + expect(reporterMock.onAllMutantsTested).calledBefore(reporterMock.onMutationTestReportReady); + }); + it('should copy thresholds', () => { const actualReport = actReportAll(); expect(actualReport.thresholds).eq(testInjector.options.thresholds);