@@ -49,6 +49,11 @@ describe("AuthService", () => {
49
49
expect ( user . statusCode ) . toEqual ( HttpStatus . CREATED ) ;
50
50
expect ( user . message ) . toEqual ( "創建成功" ) ;
51
51
} ) ;
52
+ afterEach ( async ( ) => {
53
+ if ( userRepository && userRepository . clear ) {
54
+ await userRepository . clear ( ) ;
55
+ }
56
+ } ) ;
52
57
it ( "應該會發生 email、account 已被註冊衝突" , async ( ) => {
53
58
const createUserDto1 : CreateUserDto = {
54
59
@@ -68,6 +73,11 @@ describe("AuthService", () => {
68
73
} ) ;
69
74
}
70
75
} ) ;
76
+ afterEach ( async ( ) => {
77
+ if ( userRepository && userRepository . clear ) {
78
+ await userRepository . clear ( ) ;
79
+ }
80
+ } ) ;
71
81
it ( "應該會發生 email 已被註冊衝突" , async ( ) => {
72
82
const test_data1 : CreateUserDto = {
73
83
@@ -95,6 +105,11 @@ describe("AuthService", () => {
95
105
} ) ;
96
106
}
97
107
} ) ;
108
+ afterEach ( async ( ) => {
109
+ if ( userRepository && userRepository . clear ) {
110
+ await userRepository . clear ( ) ;
111
+ }
112
+ } ) ;
98
113
it ( "應該會發生 account 已被註冊衝突" , async ( ) => {
99
114
const test_data1 : CreateUserDto = {
100
115
0 commit comments