Closed martinmckenna closed 6 years ago
Sorry for the late reply. Did you ever fix this?
If you didn't, did you try doing this? I think if you rename it, the mocking may not work as it's going to go through the normal fetch instead of the mocked versioon
global.fetch = require('jest-fetch-mock');
Can I see where you call fetch?
@jefflau yeah changing it to global.fetch worked.
Thanks for updating.
I'm getting a really weird issue where my network request is failing in the test with jest-fetch-mock, despite working when I run the app locally.
My test looks like this
my
setupTests.js
And then this is the result of the test
As you can see at the bottom, my network request failed.