Open eiswind opened 5 years ago
I can see that its defined on MockInstance, but I fail to make it accessible. Is there any trick that it needs to be imported?
I think the problem is the FetchMock is defined as:
export interface FetchMock extends jest.MockInstance<any> {
But the jest type has two generics:
interface MockInstance<T, Y extends any[]> {
Changing the FetchMock definition to:
export interface FetchMock extends jest.MockInstance<any, any> {
fixes the issue
This is a duplicate to #108
In the examples I can see things like:
expect(fetch.mock.calls.length).toEqual(1) expect(fetch.mock.calls[0][0]).toEqual('https://google.com')
unfortunately this is not defined in the typescript files.