New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: Response is not defined #13
Comments
ok, I've fixed my issue by adding |
Same issue, but adding the |
I have absolutely no idea. The problem seemed to come out of nowhere and disappears with this fix while it was working perfectly without it, the day before... |
Looking at @jefflau - Should we be setting these globals (
|
Adding the |
Furthermore, before I imported
After adding // Adding 'jest-fetch-mock' will suppress `flattenChildren(...)` error,
// but introduce the `Response is not defined` error.
global.fetch = require('jest-fetch-mock'); After adding // After adding `import 'isomorphic-fetch'`,
// the `Response is not defined` error was gone,
// but the `flattenChildren(...)` error was back again.
import 'isomorphic-fetch'
global.fetch = require('jest-fetch-mock'); |
#8 did also fix it and I don't know why that was undone again |
I'm doing it like this in my jest setup file now: const { Response, Headers, Request } = require('whatwg-fetch');
global.Response = Response;
global.Headers = Headers;
global.Request = Request; |
I've merged in a PR that now supports blobs and uses |
Hi!
I'm experiencing a strange bug today. I was using your module successfully until this morning when suddenly all my test suites failed with error:
The only thing I did was removing my node-modules folder and then
npm install
them again. I imagine that I had some modules (or version of modules) in cache that disappeared with therm
command and were replaced by a new one after that. 🤔But it doesn't seems that any module associated with
jest-fetch-mock
has changed since yesterday.I've attached a little project that should reproduce the bug. Just unzip it and run:
Thanks in advance for your help!
BugFetchJest.zip
The text was updated successfully, but these errors were encountered: