-
Notifications
You must be signed in to change notification settings - Fork 241
/
Reporter.ts
65 lines (55 loc) · 2.07 KB
/
Reporter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { MutationTestResult } from 'mutation-testing-report-schema';
import MatchedMutant from './MatchedMutant';
import MutantResult from './MutantResult';
import ScoreResult from './ScoreResult';
import SourceFile from './SourceFile';
/**
* Represents a reporter which can report during or after a Stryker run
*/
interface Reporter {
/**
* Called when a source file was loaded
* @param file The immutable source file
*/
onSourceFileRead?(file: SourceFile): void;
/**
* Called when all source files were loaded
* @param files The immutable source files
*/
onAllSourceFilesRead?(files: SourceFile[]): void;
/**
* Called when mutants are matched with tests
* @param results The immutable array of mutants
*/
onAllMutantsMatchedWithTests?(results: readonly MatchedMutant[]): void;
/**
* Called when a mutant was tested
* @param result The immutable result
*/
onMutantTested?(result: MutantResult): void;
/**
* Called when all mutants were tested
* @param results The immutable results
*/
onAllMutantsTested?(results: MutantResult[]): void;
/**
* DEPRECATED: Please use onMutationTestReportReady and the mutation-testing-metrics npm package.
* Called when the mutation score is calculated.
* @param score The immutable structured score result (tree)
*/
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
* Stryker will not close until the promise is either resolved or rejected.
* @return a promise which will resolve when the reporter is done reporting
*/
wrapUp?(): void | Promise<void>;
}
export default Reporter;