diff --git a/test/e2e/middleware-responses/test/index.test.ts b/test/e2e/middleware-responses/test/index.test.ts index 1cade1371abd7eb..6fd4bcd9623cbe0 100644 --- a/test/e2e/middleware-responses/test/index.test.ts +++ b/test/e2e/middleware-responses/test/index.test.ts @@ -33,9 +33,7 @@ describe('Middleware Responses', () => { const res = await fetchViaHTTP(next.url, `${locale}/stream-a-response`) expect(res.status).toBe(500) - if ((global as any).isNextDeploy) { - expect(await res.text()).toContain('EDGE_FUNCTION_INVOCATION_FAILED') - } else { + if (!(global as any).isNextDeploy) { expect(await res.text()).toEqual('Internal Server Error') expect(next.cliOutput).toContain( `A middleware can not alter response's body. Learn more: https://nextjs.org/docs/messages/returning-response-body-in-middleware` @@ -47,9 +45,7 @@ describe('Middleware Responses', () => { const res = await fetchViaHTTP(next.url, `${locale}/send-response`) expect(res.status).toBe(500) - if ((global as any).isNextDeploy) { - expect(await res.text()).toContain('EDGE_FUNCTION_INVOCATION_FAILED') - } else { + if (!(global as any).isNextDeploy) { expect(await res.text()).toEqual('Internal Server Error') expect(next.cliOutput).toContain( `A middleware can not alter response's body. Learn more: https://nextjs.org/docs/messages/returning-response-body-in-middleware`