You can tell TypeScript that you’re defining global.fetch as a Jest mock.
global.fetch = jest.fn(() =>
Promise.resolve({
json: () => Promise.resolve({ test: 100 }),
}),
) as jest.Mock;
You can tell TypeScript that you’re defining global.fetch as a Jest mock.
global.fetch = jest.fn(() =>
Promise.resolve({
json: () => Promise.resolve({ test: 100 }),
}),
) as jest.Mock;