chore: add cleanup to api auth strategy e2e test apiv2 (#15875)

This commit is contained in:
Morgan authored and GitHub committed 2024-07-23 12:22:46 +00:00
1 parent b8610dc2d1
commit c209c22b98
1 file changed
+9 -3
@@ -37,9 +37,9 @@ describe("ApiAuthStrategy", () => {
const validAccessTokenEmail = "[email protected]";
let validApiKeyUser: User;
let validAccessTokenUser: User;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
let module: TestingModule;
beforeAll(async () => {
module = await Test.createTestingModule({
imports: [
ConfigModule.forRoot({
ignoreEnvFile: true,
@@ -177,4 +177,10 @@ describe("ApiAuthStrategy", () => {
}
});
});
afterAll(async () => {
await userRepositoryFixture.deleteByEmail(validApiKeyEmail);
await userRepositoryFixture.deleteByEmail(validAccessTokenEmail);
module.close();
});
});