@@ -220,8 +220,6 @@ describe('Express Middleware tests', () => {
220220
221221 middleware ( mockRequest as Request , mockResponse as Response , nextFunction ) ;
222222
223- // We don't actually call json
224- expect ( mockResponse . json ) . toBeCalledWith ( expectedResponse ) ;
225223 expect ( mockResponse . locals ) . toHaveProperty ( 'complexity' ) ;
226224 expect ( mockResponse . locals ?. complexity ) . toBeInstanceOf ( 'number' ) ;
227225 expect ( mockResponse . locals ?. complexity ) . toBeGreaterThanOrEqual ( 0 ) ;
@@ -290,11 +288,9 @@ describe('Express Middleware tests', () => {
290288 ` ,
291289 } ,
292290 } ;
293- const expectedResponse = {
294- status : 429 ,
295- } ;
296291
297292 middleware ( mockRequest as Request , mockResponse as Response , nextFunction ) ;
293+ // FIXME: status is a function. Where does 439 actaully get set.
298294 expect ( mockResponse . status ) . toBe ( 429 ) ;
299295 expect ( nextFunction ) . not . toBeCalled ( ) ;
300296
@@ -327,7 +323,6 @@ describe('Express Middleware tests', () => {
327323 test ( 'Uses User IP Address in Redis' , async ( ) => {
328324 const client : RedisClientType = redis . createClient ( ) ;
329325 // Check for change in the redis store for the IP key
330- if ( ! mockRequest . ip ) throw new Error ( 'Expected ip to exist on mockRequest' ) ;
331326 const initialValue : string | null = await client . get ( mockRequest ?. ip ) ;
332327
333328 middleware ( mockRequest as Request , mockResponse as Response , nextFunction ) ;
0 commit comments