diff --git a/CHANGELOG.md b/CHANGELOG.md index 010e2c3aa459..4d1eee2fa147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - `[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)) - `[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)) - `[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)) +- `[@jest/reporters]` Marks Reporter's hooks as optional ([#14433](https://github.com/jestjs/jest/pull/14433)) ### Chore & Maintenance diff --git a/packages/jest-reporters/src/types.ts b/packages/jest-reporters/src/types.ts index 3f285ba9f285..a33e6ddd4f65 100644 --- a/packages/jest-reporters/src/types.ts +++ b/packages/jest-reporters/src/types.ts @@ -42,17 +42,17 @@ export interface Reporter { test: Test, testCaseResult: TestCaseResult, ) => Promise | void; - readonly onRunStart: ( + readonly onRunStart?: ( results: AggregatedResult, options: ReporterOnStartOptions, ) => Promise | void; readonly onTestStart?: (test: Test) => Promise | void; readonly onTestFileStart?: (test: Test) => Promise | void; - readonly onRunComplete: ( + readonly onRunComplete?: ( testContexts: Set, results: AggregatedResult, ) => Promise | void; - readonly getLastError: () => Error | void; + readonly getLastError?: () => Error | void; } export type ReporterContext = {