chore: Reduce test boilerplate (#4300)

* chore: Reduce test boilerplate

* mo
This commit is contained in:
Tom Moor
2022-10-15 22:40:21 -04:00
committed by GitHub
parent 1915a453db
commit 1fbc000e03
72 changed files with 134 additions and 439 deletions

View File

@@ -1,10 +1,10 @@
import { CollectionPermission } from "@shared/types";
import { buildUser, buildTeam, buildCollection } from "@server/test/factories";
import { getTestDatabase } from "@server/test/support";
import { setupTestDatabase } from "@server/test/support";
import CollectionUser from "./CollectionUser";
import UserAuthentication from "./UserAuthentication";
const db = getTestDatabase();
setupTestDatabase();
beforeAll(() => {
jest.useFakeTimers().setSystemTime(new Date("2018-01-02T00:00:00.000Z"));
@@ -12,11 +12,8 @@ beforeAll(() => {
afterAll(() => {
jest.useRealTimers();
db.disconnect();
});
beforeEach(db.flush);
describe("user model", () => {
describe("destroy", () => {
it("should delete user authentications", async () => {