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,22 +486,28 @@ function runTests(dev = false) {
})
it('should not warn if response body is larger than 4MB with responseLimit config = false', async () => {
let res = await fetchViaHTTP(appPort, '/api/large-response-with-config')
expect(res.ok).toBeTruthy()
expect(stderr).not.toContain(
'API response for /api/large-response-with-config exceeds 4MB. API Routes are meant to respond quickly.'
)
await check(async () => {
let res = await fetchViaHTTP(appPort, '/api/large-response-with-config')
expect(res.ok).toBeTruthy()
expect(stderr).not.toContain(
'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 () => {
let res = await fetchViaHTTP(
appPort,
'/api/large-response-with-config-size'
)
expect(res.ok).toBeTruthy()
expect(stderr).toContain(
'API response for /api/large-response-with-config-size exceeds 5MB. API Routes are meant to respond quickly.'
)
await check(async () => {
let res = await fetchViaHTTP(
appPort,
'/api/large-response-with-config-size'
)
expect(res.ok).toBeTruthy()
expect(stderr).toContain(
'API response for /api/large-response-with-config-size exceeds 5MB. API Routes are meant to respond quickly.'
)
return 'success'
}, 'success')
})
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