| 1 | declare const __DEV__: boolean; |
| 2 | declare const __TEST__: boolean; |
| 3 | declare const __EXTENSION__: boolean; |
| 4 | |
| 5 | declare function afterEach(fn: any): any; |
| 6 | declare function beforeEach(fn: any): any; |
| 7 | declare function describe(name: string, fn: any): void; |
| 8 | declare const it: { |
| 9 | (name: string, fn: any): void; |
| 10 | only: (name: string, fn: any) => void; |
| 11 | }; |
| 12 | declare function expect(val: any): Expect; |
| 13 | declare const jest: Jest; |
| 14 | declare function pit(name: string, fn: any): void; |
| 15 | declare function spyOnDev(obj: any, key: string): any; |
| 16 | declare function spyOnDevAndProd(obj: any, key: string): any; |
| 17 | declare function spyOnProd(obj: any, key: string): any; |
| 18 | declare function xdescribe(name: string, fn: any): void; |
| 19 | declare function xit(name: string, fn: any): void; |
| 20 | |
| 21 | interface Expect { |
| 22 | not: Expect; |
| 23 | toThrow(message?: string): void; |
| 24 | toThrowError(message?: string): void; |
| 25 | toBe(value: any): void; |
| 26 | toEqual(value: any): void; |
| 27 | toBeFalsy(): void; |
| 28 | toBeTruthy(): void; |
| 29 | toBeNull(): void; |
| 30 | toBeUndefined(): void; |
| 31 | toBeDefined(): void; |
| 32 | toMatch(regexp: RegExp): void; |
| 33 | toContain(string: string): void; |
| 34 | toBeCloseTo(number: number, delta: number): void; |
| 35 | toBeGreaterThan(number: number): void; |
| 36 | toBeLessThan(number: number): void; |
| 37 | toBeCalled(): void; |
| 38 | toBeCalledWith(...arguments): void; |
| 39 | lastCalledWith(...arguments): void; |
| 40 | } |
| 41 | |
| 42 | interface Jest { |
| 43 | autoMockOff(): void; |
| 44 | autoMockOn(): void; |
| 45 | clearAllTimers(): void; |
| 46 | dontMock(moduleName: string): void; |
| 47 | genMockFromModule(moduleObj: Object): Object; |
| 48 | genMockFunction(): MockFunction; |
| 49 | genMockFn(): MockFunction; |
| 50 | mock(moduleName: string): void; |
| 51 | runAllTicks(): void; |
| 52 | runAllTimers(): void; |
| 53 | runOnlyPendingTimers(): void; |
| 54 | setMock(moduleName: string, moduleExports: Object): void; |
| 55 | } |
| 56 | |
| 57 | interface MockFunction { |
| 58 | (...arguments): any; |
| 59 | mock: { |
| 60 | calls: Array<Array<any>>; |
| 61 | instances: Array<Object>; |
| 62 | }; |
| 63 | mockClear(): void; |
| 64 | mockImplementation(fn: Function): MockFunction; |
| 65 | mockImpl(fn: Function): MockFunction; |
| 66 | mockReturnThis(): MockFunction; |
| 67 | mockReturnValue(value: any): MockFunction; |
| 68 | mockReturnValueOnce(value: any): MockFunction; |
| 69 | } |
| 70 | |
| 71 | declare const check: any; |
| 72 | declare const gen: any; |