jest-fetch-mock
jest-fetch-mock copied to clipboard
Jest mock for fetch
It seems this repo is being actively worked on but there hasn't been a version published to NPM for 2 years. I'm having to include the repository URL in my...
In addition to `string`, the [`Response` constructor](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response) supports several other types. That is important for mocking an `arrayBuffer` response. Unfortunately, the typing for `MockResponseInitFunction` only supports `string`. The following works...
Hello everyone! Is it possible to mock 2 responses with the same method and URL, but making the first one returning a 400 and the second one a 200?
resolves #122 From https://github.com/jefflau/jest-fetch-mock/issues/122#issuecomment-913774897
Is it possible to configure the headers globally with the default value as `{ headers: { 'content-type': 'application/json' }}`? Currently everytime I try to do a `mockResponseOnce` it set the...
So as the title implies `` fetch.mockResets() `` isn't resetting the the fetch. here is my full test.js: ```import Statistic from './Statistics'; import Worker from '../statistics-worker/worker'; jest.mock("../statistics-worker/worker"); const workerInitProps =...
I'm using react-native with expo, jest-fetch-mock and graphql. When calling the api Im getting error × return user feed query (69ms) ● testing api › return user feed query at...
Both seem to do the same thing, why are there 2 libraries? I couldn't find a reference to each other library on either project side, so I wonder what are...
👋 @yinzara This would add support for the issue referenced in #218. This would be really useful for me and perhaps others as well! Let me know if this looks...