Skip to content

Commit 8426b5d

Browse files
Marks Reporter's hooks as optional (#14433)
1 parent 085f063 commit 8426b5d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- `[jest-mock]` Revert [#13692](https://github.com/jestjs/jest/pull/13692) as it was a breaking change ([#14429](https://github.com/jestjs/jest/pull/14429))
1212
- `[jest-mock]` Revert [#13866](https://github.com/jestjs/jest/pull/13866) as it was a breaking change ([#14429](https://github.com/jestjs/jest/pull/14429))
1313
- `[jest-mock]` Revert [#13867](https://github.com/jestjs/jest/pull/13867) as it was a breaking change ([#14429](https://github.com/jestjs/jest/pull/14429))
14+
- `[@jest/reporters]` Marks Reporter's hooks as optional ([#14433](https://github.com/jestjs/jest/pull/14433))
1415

1516
### Chore & Maintenance
1617

packages/jest-reporters/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ export interface Reporter {
4242
test: Test,
4343
testCaseResult: TestCaseResult,
4444
) => Promise<void> | void;
45-
readonly onRunStart: (
45+
readonly onRunStart?: (
4646
results: AggregatedResult,
4747
options: ReporterOnStartOptions,
4848
) => Promise<void> | void;
4949
readonly onTestStart?: (test: Test) => Promise<void> | void;
5050
readonly onTestFileStart?: (test: Test) => Promise<void> | void;
51-
readonly onRunComplete: (
51+
readonly onRunComplete?: (
5252
testContexts: Set<TestContext>,
5353
results: AggregatedResult,
5454
) => Promise<void> | void;
55-
readonly getLastError: () => Error | void;
55+
readonly getLastError?: () => Error | void;
5656
}
5757

5858
export type ReporterContext = {

0 commit comments

Comments
 (0)