@@ -486,22 +486,28 @@ function runTests(dev = false) {
486486 } )
487487
488488 it ( 'should not warn if response body is larger than 4MB with responseLimit config = false' , async ( ) => {
489- let res = await fetchViaHTTP ( appPort , '/api/large-response-with-config' )
490- expect ( res . ok ) . toBeTruthy ( )
491- expect ( stderr ) . not . toContain (
492- 'API response for /api/large-response-with-config exceeds 4MB. API Routes are meant to respond quickly.'
493- )
489+ await check ( async ( ) => {
490+ let res = await fetchViaHTTP ( appPort , '/api/large-response-with-config' )
491+ expect ( res . ok ) . toBeTruthy ( )
492+ expect ( stderr ) . not . toContain (
493+ 'API response for /api/large-response-with-config exceeds 4MB. API Routes are meant to respond quickly.'
494+ )
495+ return 'success'
496+ } , 'success' )
494497 } )
495498
496499 it ( 'should warn with configured size if response body is larger than configured size' , async ( ) => {
497- let res = await fetchViaHTTP (
498- appPort ,
499- '/api/large-response-with-config-size'
500- )
501- expect ( res . ok ) . toBeTruthy ( )
502- expect ( stderr ) . toContain (
503- 'API response for /api/large-response-with-config-size exceeds 5MB. API Routes are meant to respond quickly.'
504- )
500+ await check ( async ( ) => {
501+ let res = await fetchViaHTTP (
502+ appPort ,
503+ '/api/large-response-with-config-size'
504+ )
505+ expect ( res . ok ) . toBeTruthy ( )
506+ expect ( stderr ) . toContain (
507+ 'API response for /api/large-response-with-config-size exceeds 5MB. API Routes are meant to respond quickly.'
508+ )
509+ return 'success'
510+ } , 'success' )
505511 } )
506512
507513 if ( dev ) {
0 commit comments