-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.d.ts
27 lines (22 loc) · 948 Bytes
/
index.d.ts
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
import { InspectionFilter, InspectionOptions, FetchMockStatic, MockCall, FetchMockSandbox } from 'fetch-mock';
declare global {
namespace jest {
interface Matchers<R> {
toHaveFetched(filter?: InspectionFilter, options?: InspectionOptions): R;
toHaveLastFetched(filter?: InspectionFilter, options?: InspectionOptions): R;
toHaveNthFetched(n: number, filter?: InspectionFilter, options?: InspectionOptions): R;
toHaveFetchedTimes(times: number, filter?: InspectionFilter, options?: InspectionOptions): R;
toBeDone(filter?: InspectionFilter): R;
}
}
}
interface FetchMockJest {
// Reset the call history
mockClear(): void;
// Remove all configured mocks
mockReset(): void;
// Enable sandbox mode
sandbox(): jest.MockInstance<Response, MockCall> & FetchMockSandbox;
}
declare const fetchMockJest: FetchMockJest & jest.MockInstance<Response, MockCall> & FetchMockStatic
export = fetchMockJest;