-
-
Save reime005/ff13b11a16a211bfb7f5bb277cabcea0 to your computer and use it in GitHub Desktop.
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
/* src/mock-api.js */ | |
import fetchMock from 'fetch-mock'; | |
fetchMock.get(`glob:https://example-api.com/test`, () => { | |
return new Promise(resolve => { | |
setTimeout(() => { | |
resolve({ | |
status: 200, | |
body: { increment: 1 }, | |
}); | |
}, 1000) // simulate server work/load | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment