Unverified Commit ca134f6d authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update flakey API support tests (#45360)

x-ref:
https://github.com/vercel/next.js/actions/runs/4027758161/jobs/6923946045
parent 01cd4ab4
...@@ -486,14 +486,18 @@ function runTests(dev = false) { ...@@ -486,14 +486,18 @@ function runTests(dev = false) {
}) })
it('should not warn if response body is larger than 4MB with responseLimit config = false', async () => { it('should not warn if response body is larger than 4MB with responseLimit config = false', async () => {
await check(async () => {
let res = await fetchViaHTTP(appPort, '/api/large-response-with-config') let res = await fetchViaHTTP(appPort, '/api/large-response-with-config')
expect(res.ok).toBeTruthy() expect(res.ok).toBeTruthy()
expect(stderr).not.toContain( expect(stderr).not.toContain(
'API response for /api/large-response-with-config exceeds 4MB. API Routes are meant to respond quickly.' 'API response for /api/large-response-with-config exceeds 4MB. API Routes are meant to respond quickly.'
) )
return 'success'
}, 'success')
}) })
it('should warn with configured size if response body is larger than configured size', async () => { it('should warn with configured size if response body is larger than configured size', async () => {
await check(async () => {
let res = await fetchViaHTTP( let res = await fetchViaHTTP(
appPort, appPort,
'/api/large-response-with-config-size' '/api/large-response-with-config-size'
...@@ -502,6 +506,8 @@ function runTests(dev = false) { ...@@ -502,6 +506,8 @@ function runTests(dev = false) {
expect(stderr).toContain( expect(stderr).toContain(
'API response for /api/large-response-with-config-size exceeds 5MB. API Routes are meant to respond quickly.' 'API response for /api/large-response-with-config-size exceeds 5MB. API Routes are meant to respond quickly.'
) )
return 'success'
}, 'success')
}) })
if (dev) { if (dev) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment