From edfdf647e60f56a71d44dd0b85717eddfa5e8f4c Mon Sep 17 00:00:00 2001 From: a20688392 Date: Sun, 4 Jun 2023 21:33:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20auth=20service=20=E5=96=AE=E5=85=83?= =?UTF-8?q?=E6=B8=AC=E8=A9=A6=E5=8A=A0=E4=B8=8A=E6=B8=AC=E8=A9=A6=E5=BE=8C?= =?UTF-8?q?=E5=BE=A9=E5=8E=9F=E8=B3=87=E6=96=99=E5=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auth/auth.service.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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",