forked from jestjs/jest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJest.js
53 lines (50 loc) · 1.55 KB
/
Jest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
type JestMockFn = Function;
export type LocalModuleRequire = (moduleName: string) => any;
export type Jest = {|
addMatchers(matchers: Object): void,
autoMockOff(): Jest,
autoMockOn(): Jest,
clearAllMocks(): Jest,
clearAllTimers(): void,
deepUnmock(moduleName: string): Jest,
disableAutomock(): Jest,
doMock(moduleName: string, moduleFactory?: any): Jest,
dontMock(moduleName: string): Jest,
enableAutomock(): Jest,
fn: (implementation?: Function) => JestMockFn,
genMockFromModule(moduleName: string): any,
isMockFunction(fn: Function): boolean,
mock(moduleName: string, moduleFactory?: any, options?: Object): Jest,
requireActual: LocalModuleRequire,
requireMock: LocalModuleRequire,
resetAllMocks(): Jest,
resetModuleRegistry(): Jest,
resetModules(): Jest,
restoreAllMocks(): Jest,
retryTimes(numRetries: number): Jest,
runAllImmediates(): void,
runAllTicks(): void,
runAllTimers(): void,
runOnlyPendingTimers(): void,
advanceTimersByTime(msToRun: number): void,
runTimersToTime(msToRun: number): void,
getTimerCount(): number,
setMock(moduleName: string, moduleExports: any): Jest,
setTimeout(timeout: number): Jest,
spyOn(
object: Object,
methodName: string,
accessType?: 'get' | 'set',
): JestMockFn,
unmock(moduleName: string): Jest,
useFakeTimers(): Jest,
useRealTimers(): Jest,
|};