From e293f8e01fa605c5f6791ccbe1c65140862e1ace Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Tue, 9 Apr 2019 14:51:28 -0700 Subject: [PATCH] add getEnv to jest's type definition Reviewed By: AGS- Differential Revision: D14858004 fbshipit-source-id: 38ef0283f5605f6a13d179d8c68dd26c63adb910 --- flow/jest.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flow/jest.js b/flow/jest.js index d26ab844e..799978ca4 100644 --- a/flow/jest.js +++ b/flow/jest.js @@ -1143,6 +1143,17 @@ declare function spyOn(value: mixed, method: string): Object; /** Holds all functions related to manipulating test runner */ declare var jest: JestObjectType; +/** + * https://jasmine.github.io/2.4/custom_reporter.html + */ +type JasmineReporter = { + jasmineStarted?: (suiteInfo: mixed) => void, + suiteStarted?: (result: mixed) => void, + specStarted?: (result: mixed) => void, + specDone?: (result: mixed) => void, + suiteDone?: (result: mixed) => void, +}; + /** * The global Jasmine object, this is generally not exposed as the public API, * using features inside here could break in later versions of Jest. @@ -1158,6 +1169,7 @@ declare var jasmine: { baseName: string, methodNames: Array, ): {[methodName: string]: JestSpyType}, + getEnv(): {addReporter: (jasmineReporter: JasmineReporter) => void}, objectContaining(value: Object): Object, stringMatching(value: string): string, };