Created
February 10, 2021 11:51
-
-
Save rw3iss/a94d2ec30d5b52fbc68c1c21a1a7c486 to your computer and use it in GitHub Desktop.
isomorphic-fetch for fetchMock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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