init commit,

This commit is contained in:
louiscklaw
2025-05-28 09:55:51 +08:00
commit efe70ceb69
8042 changed files with 951668 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import prisma from '../../src/client';
import { beforeAll, beforeEach, afterAll } from '@jest/globals';
const setupTestDB = () => {
beforeAll(async () => {
await prisma.$connect();
});
beforeEach(async () => {
await prisma.token.deleteMany();
await prisma.user.deleteMany();
});
afterAll(async () => {
await prisma.token.deleteMany();
await prisma.user.deleteMany();
await prisma.$disconnect();
});
};
export default setupTestDB;