Skip to content

Commit 91aeb8d

Browse files
committed
chore: sync test from upstream
1 parent ea72c18 commit 91aeb8d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/e2e/tests/middleware-responses/test/index.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,23 @@ describe('Middleware Responses', () => {
2929
])
3030
})
3131

32-
it(`${label}should fail when returning a stream`, async () => {
32+
it(`${label}should not fail when returning a stream`, async () => {
3333
const res = await fetchViaHTTP(next.url, `${locale}/stream-a-response`)
34-
expect(res.status).toBe(500)
34+
expect(res.status).toBe(200)
3535

3636
if (!(global as any).isNextDeploy) {
37-
expect(await res.text()).toEqual('Internal Server Error')
38-
expect(next.cliOutput).toContain(
37+
expect(next.cliOutput).not.toContain(
3938
`A middleware can not alter response's body. Learn more: https://nextjs.org/docs/messages/returning-response-body-in-middleware`
4039
)
4140
}
4241
})
4342

44-
it(`${label}should fail when returning a text body`, async () => {
43+
it(`${label}should not fail when returning a text body`, async () => {
4544
const res = await fetchViaHTTP(next.url, `${locale}/send-response`)
46-
expect(res.status).toBe(500)
45+
expect(res.status).toBe(200)
4746

4847
if (!(global as any).isNextDeploy) {
49-
expect(await res.text()).toEqual('Internal Server Error')
50-
expect(next.cliOutput).toContain(
48+
expect(next.cliOutput).not.toContain(
5149
`A middleware can not alter response's body. Learn more: https://nextjs.org/docs/messages/returning-response-body-in-middleware`
5250
)
5351
}

0 commit comments

Comments
 (0)