diff --git a/src/auth/auth.service.spec.ts b/src/auth/auth.service.spec.ts index 029648c..994a348 100644 --- a/src/auth/auth.service.spec.ts +++ b/src/auth/auth.service.spec.ts @@ -49,6 +49,11 @@ describe("AuthService", () => { expect(user.statusCode).toEqual(HttpStatus.CREATED); expect(user.message).toEqual("創建成功"); }); + afterEach(async () => { + if (userRepository && userRepository.clear) { + await userRepository.clear(); + } + }); it("應該會發生 email、account 已被註冊衝突", async () => { const createUserDto1: CreateUserDto = { email: "jhon@gmail.com", @@ -68,6 +73,11 @@ describe("AuthService", () => { }); } }); + afterEach(async () => { + if (userRepository && userRepository.clear) { + await userRepository.clear(); + } + }); it("應該會發生 email 已被註冊衝突", async () => { const test_data1: CreateUserDto = { email: "jhon@gmail.com", @@ -95,6 +105,11 @@ describe("AuthService", () => { }); } }); + afterEach(async () => { + if (userRepository && userRepository.clear) { + await userRepository.clear(); + } + }); it("應該會發生 account 已被註冊衝突", async () => { const test_data1: CreateUserDto = { email: "jhon@gmail.com",