Skip to content

Instantly share code, notes, and snippets.

@rw3iss
Created February 10, 2021 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rw3iss/a94d2ec30d5b52fbc68c1c21a1a7c486 to your computer and use it in GitHub Desktop.
Save rw3iss/a94d2ec30d5b52fbc68c1c21a1a7c486 to your computer and use it in GitHub Desktop.
isomorphic-fetch for fetchMock
const isoFetch = jest.requireActual('isomorphic-fetch');
const fetchMock = require('fetch-mock').sandbox();
Object.assign(fetchMock.config, {
fetch: isoFetch
});
fetchMock.config.fallbackToNetwork = true;
fetchMock.config.overwriteRoutes = false;
module.exports = fetchMock;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment