We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's a simple test that would demonstrate the problem.
import fetchMock from 'fetch-mock-jest'; it("should work with Response.error()", async () => { fetchMock.mock("https://trajano.net/bad-request", Response.error()); const response = await fetch("https://trajano.net/bad-request"); expect(response.status).toBe(0); });
The text was updated successfully, but these errors were encountered:
Workaround
let fetchConfigResponse: (new () => Response) | undefined; beforeEach(() => { fetchConfigResponse = fetchMock.config.Response; }) afterEach(() => { fetchMock.mockReset(); fetchMock.config.Response = fetchConfigResponse; }) it("Response.error type check", async () => { fetchMock.config.Response = Response; expect(Response.error() instanceof Response).toBe(true); expect(fetchMock.config.Response?.prototype.isPrototypeOf(Response.error())).toBe(true); });
Sorry, something went wrong.
No branches or pull requests
Here's a simple test that would demonstrate the problem.
The text was updated successfully, but these errors were encountered: