@@ -147,12 +147,13 @@ describe('WebhookController', () => {
147147 ) ;
148148
149149 expect ( mockResponse . status ) . toHaveBeenCalledWith ( 400 ) ;
150- expect ( mockResponse . json ) . toHaveBeenCalledWith ( {
151- success : true ,
152- message : 'Sentry 웹훅 처리에 실패했습니다' ,
153- data : { } ,
154- error : null
155- } ) ;
150+ expect ( mockResponse . json ) . toHaveBeenCalledWith (
151+ expect . objectContaining ( {
152+ message : 'Sentry 웹훅 처리에 실패했습니다' ,
153+ statusCode : 400 ,
154+ code : 'INVALID_SYNTAX'
155+ } )
156+ ) ;
156157 expect ( nextFunction ) . not . toHaveBeenCalled ( ) ;
157158 } ) ;
158159
@@ -166,12 +167,13 @@ describe('WebhookController', () => {
166167 ) ;
167168
168169 expect ( mockResponse . status ) . toHaveBeenCalledWith ( 400 ) ;
169- expect ( mockResponse . json ) . toHaveBeenCalledWith ( {
170- success : true ,
171- message : 'Sentry 웹훅 처리에 실패했습니다' ,
172- data : { } ,
173- error : null
174- } ) ;
170+ expect ( mockResponse . json ) . toHaveBeenCalledWith (
171+ expect . objectContaining ( {
172+ message : 'Sentry 웹훅 처리에 실패했습니다' ,
173+ statusCode : 400 ,
174+ code : 'INVALID_SYNTAX'
175+ } )
176+ ) ;
175177 } ) ;
176178
177179 it ( 'action이 없는 경우 400 에러를 반환해야 한다' , async ( ) => {
@@ -184,12 +186,13 @@ describe('WebhookController', () => {
184186 ) ;
185187
186188 expect ( mockResponse . status ) . toHaveBeenCalledWith ( 400 ) ;
187- expect ( mockResponse . json ) . toHaveBeenCalledWith ( {
188- success : true ,
189- message : 'Sentry 웹훅 처리에 실패했습니다' ,
190- data : { } ,
191- error : null
192- } ) ;
189+ expect ( mockResponse . json ) . toHaveBeenCalledWith (
190+ expect . objectContaining ( {
191+ message : 'Sentry 웹훅 처리에 실패했습니다' ,
192+ statusCode : 400 ,
193+ code : 'INVALID_SYNTAX'
194+ } )
195+ ) ;
193196 } ) ;
194197
195198 it ( '전혀 다른 형태의 객체인 경우 400 에러를 반환해야 한다' , async ( ) => {
@@ -206,12 +209,13 @@ describe('WebhookController', () => {
206209 ) ;
207210
208211 expect ( mockResponse . status ) . toHaveBeenCalledWith ( 400 ) ;
209- expect ( mockResponse . json ) . toHaveBeenCalledWith ( {
210- success : true ,
211- message : 'Sentry 웹훅 처리에 실패했습니다' ,
212- data : { } ,
213- error : null
214- } ) ;
212+ expect ( mockResponse . json ) . toHaveBeenCalledWith (
213+ expect . objectContaining ( {
214+ message : 'Sentry 웹훅 처리에 실패했습니다' ,
215+ statusCode : 400 ,
216+ code : 'INVALID_SYNTAX'
217+ } )
218+ ) ;
215219 } ) ;
216220
217221 it ( 'action은 created이지만 필수 필드가 없는 경우 에러를 전달해야 한다' , async ( ) => {
@@ -232,7 +236,9 @@ describe('WebhookController', () => {
232236
233237 expect ( nextFunction ) . toHaveBeenCalledWith (
234238 expect . objectContaining ( {
235- message : 'Sentry 웹훅 데이터가 올바르지 않습니다'
239+ message : 'Sentry 웹훅 처리에 실패했습니다' ,
240+ statusCode : 400 ,
241+ code : 'INVALID_SYNTAX'
236242 } )
237243 ) ;
238244 expect ( mockResponse . json ) . not . toHaveBeenCalled ( ) ;
0 commit comments