-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
36 lines (34 loc) · 890 Bytes
/
cypress.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import prisma from "@db/prisma";
import { defineConfig } from "cypress";
import dayjs from "dayjs";
const email = "[email protected]";
export default defineConfig({
video: false,
e2e: {
baseUrl: "http://localhost:3000",
setupNodeEvents(on) {
on("task", {
async "db:seed:user"() {
await prisma.user.deleteMany({ where: { email } });
return prisma.user.create({
data: {
email,
},
});
},
async "db:seed:session"(sessionToken: string) {
await prisma.session.deleteMany({
where: { sessionToken },
});
return prisma.session.create({
data: {
user: { connect: { email } },
expires: dayjs().add(1, "year").toDate(),
sessionToken,
},
});
},
});
},
},
});