mirror of
https://github.com/outline/outline.git
synced 2025-12-30 07:19:52 -06:00
test: fix fetch related tests
This commit is contained in:
9
server/__mocks__/fetch-with-proxy.ts
Normal file
9
server/__mocks__/fetch-with-proxy.ts
Normal 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;
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user