diff --git a/api/src/plugins/auth-dev.test.ts b/api/src/plugins/auth-dev.test.ts index 04c9b28ad09..8cf8318ce9f 100644 --- a/api/src/plugins/auth-dev.test.ts +++ b/api/src/plugins/auth-dev.test.ts @@ -40,6 +40,7 @@ describe('dev login', () => { await fastify.prisma.user.deleteMany({ where: { email: defaultUserEmail } }); + await fastify.prisma.$runCommandRaw({ dropDatabase: 1 }); await fastify.close(); }); diff --git a/api/src/plugins/auth0.test.ts b/api/src/plugins/auth0.test.ts index cfaabd8c122..a9eb10a00d8 100644 --- a/api/src/plugins/auth0.test.ts +++ b/api/src/plugins/auth0.test.ts @@ -43,6 +43,7 @@ describe('auth0 plugin', () => { }); afterAll(async () => { + await fastify.prisma.$runCommandRaw({ dropDatabase: 1 }); await fastify.close(); }); diff --git a/api/src/routes/helpers/auth-helpers.test.ts b/api/src/routes/helpers/auth-helpers.test.ts index 7c1866d9d08..d390addc681 100644 --- a/api/src/routes/helpers/auth-helpers.test.ts +++ b/api/src/routes/helpers/auth-helpers.test.ts @@ -1,4 +1,12 @@ -import { describe, test, expect, beforeAll, afterEach, vi } from 'vitest'; +import { + describe, + test, + expect, + beforeAll, + afterEach, + afterAll, + vi +} from 'vitest'; import Fastify, { FastifyInstance } from 'fastify'; import db from '../../db/prisma.js'; @@ -24,6 +32,11 @@ describe('findOrCreateUser', () => { fastify = await setupServer(); }); + afterAll(async () => { + await fastify.prisma.$runCommandRaw({ dropDatabase: 1 }); + await fastify.close(); + }); + afterEach(async () => { await fastify.prisma.user.deleteMany({ where: { email } }); await fastify.close();