test: fix fetch related tests

This commit is contained in:
Tom Moor
2022-06-30 10:37:06 +02:00
parent 930bfd5391
commit b44dc726f3
2 changed files with 10 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
import fetchMock from "jest-fetch-mock";
fetchMock.enableMocks();
// changes default behavior of fetchMock to use the real 'fetch' implementation.
// Mocks can now be enabled in each individual test with fetchMock.doMock()
fetchMock.dontMock();
export default fetch;

View File

@@ -14,12 +14,11 @@ beforeEach(() => flushdb());
beforeEach(() => {
jest.resetAllMocks();
fetchMock.resetMocks();
fetchMock.doMock();
});
const ip = "127.0.0.1";
fetchMock.enableMocks();
describe("DeliverWebhookTask", () => {
test("should hit the subscription url and record a delivery", async () => {
const subscription = await buildWebhookSubscription({