Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

mock-db-setup.test.ts

21 lines409 Bytes

1import { test as setup } from '@playwright/test'
2​
3import { PrismaClient } from '@prisma/client'
4​
5const prismaClient = new PrismaClient()
6​
7setup('create new database', async () => {
8 if (
9 await prismaClient.user.findUnique({
10 where: {
11 email: 'test2@gmail.com',
12 },
13 })
14 ) {
15 await prismaClient.user.delete({
16 where: {
17 email: 'test2@gmail.com',
18 },
19 })
20 }
21})