chore: Test performance (#5786)

This commit is contained in:
Tom Moor
2023-09-06 17:19:21 -04:00
committed by GitHub
parent 3eb947e9a5
commit ec0564eb32
69 changed files with 449 additions and 617 deletions

View File

@@ -1,5 +1,4 @@
import { buildUser, buildWebhookSubscription } from "@server/test/factories";
import { setupTestDatabase } from "@server/test/support";
import { UserEvent } from "@server/types";
import DeliverWebhookTask from "../tasks/DeliverWebhookTask";
import WebhookProcessor from "./WebhookProcessor";
@@ -7,8 +6,6 @@ import WebhookProcessor from "./WebhookProcessor";
jest.mock("../tasks/DeliverWebhookTask");
const ip = "127.0.0.1";
setupTestDatabase();
beforeEach(async () => {
jest.resetAllMocks();
});

View File

@@ -1,11 +1,8 @@
import { subDays } from "date-fns";
import { WebhookDelivery } from "@server/models";
import { buildWebhookDelivery } from "@server/test/factories";
import { setupTestDatabase } from "@server/test/support";
import CleanupWebhookDeliveriesTask from "./CleanupWebhookDeliveriesTask";
setupTestDatabase();
const deliveryExists = async (delivery: WebhookDelivery) => {
const results = await WebhookDelivery.findOne({ where: { id: delivery.id } });
return !!results;

View File

@@ -6,12 +6,9 @@ import {
buildWebhookDelivery,
buildWebhookSubscription,
} from "@server/test/factories";
import { setupTestDatabase } from "@server/test/support";
import { UserEvent } from "@server/types";
import DeliverWebhookTask from "./DeliverWebhookTask";
setupTestDatabase();
beforeEach(async () => {
jest.resetAllMocks();
fetchMock.resetMocks();