From 2290bc6690bcb93f868684c2d0b9aad687a7a680 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 10 Nov 2019 14:08:40 +0100 Subject: [PATCH 1/2] chore: make arguemnts to methods in base reporter optional --- packages/jest-reporters/src/base_reporter.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/jest-reporters/src/base_reporter.ts b/packages/jest-reporters/src/base_reporter.ts index 0224a65e2378..0d094c7f0de3 100644 --- a/packages/jest-reporters/src/base_reporter.ts +++ b/packages/jest-reporters/src/base_reporter.ts @@ -18,21 +18,21 @@ export default class BaseReporter implements Reporter { process.stderr.write(message + '\n'); } - onRunStart(_results: AggregatedResult, _options: ReporterOnStartOptions) { + onRunStart(_results?: AggregatedResult, _options?: ReporterOnStartOptions) { preRunMessageRemove(process.stderr); } onTestResult( - _test: Test, - _testResult: TestResult, - _results: AggregatedResult, + _test?: Test, + _testResult?: TestResult, + _results?: AggregatedResult, ) {} - onTestStart(_test: Test) {} + onTestStart(_test?: Test) {} onRunComplete( - _contexts: Set, - _aggregatedResults: AggregatedResult, + _contexts?: Set, + _aggregatedResults?: AggregatedResult, ): Promise | void {} protected _setError(error: Error) { From 64b76b3fd4a24807899bdf2784d6c0547023733a Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 10 Nov 2019 14:11:27 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 242c793852b2..b4dfe2310be9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - `[jest-leak-detector]` [**BREAKING**] Use `weak-napi` instead of `weak` package ([#8686](https://github.com/facebook/jest/pull/8686)) - `[jest-mock]` Fix for mockReturnValue overriding mockImplementationOnce ([#8398](https://github.com/facebook/jest/pull/8398)) - `[jest-reporters]` Make node-notifier an optional dependency ([#8918](https://github.com/facebook/jest/pull/8918)) +- `[jest-reporters]` Make all arguments to methods on `BaseReporter` optional ([#9159](https://github.com/facebook/jest/pull/9159)) - `[jest-resolve]`: Set MODULE_NOT_FOUND as error code when module is not resolved from paths ([#8487](https://github.com/facebook/jest/pull/8487)) - `[jest-snapshot]` Remove only the added newlines in multiline snapshots ([#8859](https://github.com/facebook/jest/pull/8859)) - `[jest-snapshot]` Distinguish empty string from external snapshot not written ([#8880](https://github.com/facebook/jest/pull/8880))