@@ -29,25 +29,23 @@ describe('Middleware Responses', () => {
29
29
] )
30
30
} )
31
31
32
- it ( `${ label } should fail when returning a stream` , async ( ) => {
32
+ it ( `${ label } should not fail when returning a stream` , async ( ) => {
33
33
const res = await fetchViaHTTP ( next . url , `${ locale } /stream-a-response` )
34
- expect ( res . status ) . toBe ( 500 )
34
+ expect ( res . status ) . toBe ( 200 )
35
35
36
36
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 (
39
38
`A middleware can not alter response's body. Learn more: https://nextjs.org/docs/messages/returning-response-body-in-middleware`
40
39
)
41
40
}
42
41
} )
43
42
44
- it ( `${ label } should fail when returning a text body` , async ( ) => {
43
+ it ( `${ label } should not fail when returning a text body` , async ( ) => {
45
44
const res = await fetchViaHTTP ( next . url , `${ locale } /send-response` )
46
- expect ( res . status ) . toBe ( 500 )
45
+ expect ( res . status ) . toBe ( 200 )
47
46
48
47
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 (
51
49
`A middleware can not alter response's body. Learn more: https://nextjs.org/docs/messages/returning-response-body-in-middleware`
52
50
)
53
51
}
0 commit comments