add getEnv to jest's type definition

Reviewed By: AGS-

Differential Revision: D14858004

fbshipit-source-id: 38ef0283f5605f6a13d179d8c68dd26c63adb910
This commit is contained in:
Chad Smith
2019-04-09 14:51:28 -07:00
committed by Facebook Github Bot
parent 5e5439a921
commit e293f8e01f

View File

@@ -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<string>,
): {[methodName: string]: JestSpyType},
getEnv(): {addReporter: (jasmineReporter: JasmineReporter) => void},
objectContaining(value: Object): Object,
stringMatching(value: string): string,
};