Files
zkldi_Tachi/server/src/test-utils/cleanup.ts
T
2022-04-13 16:31:55 +01:00

19 lines
626 B
TypeScript

import { CloseMongoConnection } from "external/mongo/db";
import { CloseRedisPubSub } from "external/redis/redis-IPC";
import { CloseRedisConnection } from "external/redis/redis";
import { CloseServerConnection } from "./mock-api";
import { CloseScoreImportQueue } from "lib/score-import/worker/queue";
import { WriteSnapshotData } from "./single-process-snapshot";
export async function CleanUpAfterTests() {
if (process.env.TAP_SNAPSHOT) {
WriteSnapshotData();
}
await CloseMongoConnection();
await CloseServerConnection();
await CloseRedisConnection();
await CloseRedisPubSub();
await CloseScoreImportQueue();
}