React Testing with Enzyme and Jest ReferenceError: fetch is not defined

Viewed 2102

In my enzyme/jest tests on my React component, I get a warning

(node:8898) UnhandledPromiseRejectionWarning: ReferenceError: fetch is not defined

that appears randomly in the logs of my tested components.

None of the tested components calls for a fetch directly.

I read about to implement libraries like node-fetch from here

ReferenceError: fetch is not defined

but as I import them, they are actually not being called.

I would like to get rid of those warnings, does anyone have an idea on how to resolve the warnings?

0 Answers
Related