chore: Reduce test boilerplate (#4300)
* chore: Reduce test boilerplate * mo
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
import { buildUser, buildCollection } from "@server/test/factories";
|
||||
import { getTestDatabase, getTestServer } from "@server/test/support";
|
||||
import { getTestServer } from "@server/test/support";
|
||||
|
||||
const db = getTestDatabase();
|
||||
const server = getTestServer();
|
||||
|
||||
afterAll(server.disconnect);
|
||||
|
||||
beforeEach(db.flush);
|
||||
|
||||
describe("auth/redirect", () => {
|
||||
it("should redirect to home", async () => {
|
||||
const user = await buildUser();
|
||||
|
||||
@@ -3,15 +3,10 @@ import SigninEmail from "@server/emails/templates/SigninEmail";
|
||||
import WelcomeEmail from "@server/emails/templates/WelcomeEmail";
|
||||
import env from "@server/env";
|
||||
import { buildUser, buildGuestUser, buildTeam } from "@server/test/factories";
|
||||
import { getTestDatabase, getTestServer } from "@server/test/support";
|
||||
import { getTestServer } from "@server/test/support";
|
||||
|
||||
const db = getTestDatabase();
|
||||
const server = getTestServer();
|
||||
|
||||
afterAll(server.disconnect);
|
||||
|
||||
beforeEach(db.flush);
|
||||
|
||||
describe("email", () => {
|
||||
it("should require email param", async () => {
|
||||
const res = await server.post("/auth/email", {
|
||||
|
||||
Reference in New Issue
Block a user