Skip to content

Commit

Permalink
feat(reporter): add mutationReportReady event
Browse files Browse the repository at this point in the history
Add the `onMutationTestReportReady` reporter interface method.
The argument is the report that is compliant to the
[mutation-testing-report-schema](https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/mutation-testing-report-schema)
  • Loading branch information
nicojs committed Apr 2, 2019
1 parent abcf0d9 commit 044158d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"tslib": "~1.9.3"
},
"devDependencies": {
"mutation-testing-report-schema": "^1.0.0",
"surrial": "~1.0.0",
"typed-inject": "~1.0.0"
}
Expand Down
8 changes: 8 additions & 0 deletions packages/api/report.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import * as mutationTestReportSchema from 'mutation-testing-report-schema/dist/src/api';
export { default as Reporter } from './src/report/Reporter';
export { default as MutantResult } from './src/report/MutantResult';
export { default as MutantStatus } from './src/report/MutantStatus';
export { default as SourceFile } from './src/report/SourceFile';
export { default as MatchedMutant } from './src/report/MatchedMutant';
export { default as ScoreResult } from './src/report/ScoreResult';
export {
/**
* Types exported directly from mutation-testing-schema
* @see https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/mutation-testing-report-schema
*/
mutationTestReportSchema
};
8 changes: 8 additions & 0 deletions packages/api/src/report/Reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import ScoreResult from './ScoreResult';
import SourceFile from './SourceFile';
import MutantResult from './MutantResult';
import MatchedMutant from './MatchedMutant';
import { MutationTestResult } from 'mutation-testing-report-schema';

/**
* Represents a reporter which can report during or after a Stryker run
Expand Down Expand Up @@ -44,6 +45,13 @@ interface Reporter {
*/
onScoreCalculated?(score: ScoreResult): void;

/**
* Called when mutation testing is done
* @param report the mutation test result that is valid according to the mutation-testing-report-schema (json schema)
* @see https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/mutation-testing-report-schema#mutation-testing-elements-schema
*/
onMutationTestReportReady?(report: MutationTestResult): void;

/**
* Called when stryker wants to quit
* Gives a reporter the ability to finish up any async tasks
Expand Down

0 comments on commit 044158d

Please sign in to comment.