wheresrhys/fetch-mock-jest

Mock calls number stay at 0

Closed this issue · 2 comments

So i made a simple jest test :

import fetchMock from 'fetch-mock-jest';

test('Toto', async () => {
    fetchMock.mock('https://toto.com', 200);

    await fetch('https://toto.com');

    expect(fetchMock).toHaveBeenCalled();
});

This test fails, I've tried without asyn/await too. Did I miss something ?

Can you provide more details of your environment. Ideally a small reduced test case repo I can checkout

closing due to inactivity. Feel free to reopen if you can provide more details