Unverified Commit d1257866 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Deflake nested `after()` tests (#85566)

parent d349bd08
......@@ -58,24 +58,27 @@ describe('nextjs APIs in after()', () => {
`[${path}] headers(): error: Error: Route ${path} used \`headers()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] nested headers(): ok`)
expect(logs).not.toContain(`[${path}] cookies(): ok`)
expect(logs).toContain(
`[${path}] nested headers(): error: Error: Route ${path} used \`headers()\` inside \`after()\`. This is not supported.`
`[${path}] cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] cookies(): ok`)
expect(logs).not.toContain(`[${path}] connection(): ok`)
expect(logs).toContain(
`[${path}] cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
`[${path}] connection(): error: Error: Route ${path} used \`connection()\` inside \`after()\`.`
)
})
await retry(() => {
const logs = getLogs()
expect(logs).not.toContain(`[${path}] nested cookies(): ok`)
expect(logs).not.toContain(`[${path}] nested headers(): ok`)
expect(logs).toContain(
`[${path}] nested cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
`[${path}] nested headers(): error: Error: Route ${path} used \`headers()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] connection(): ok`)
expect(logs).not.toContain(`[${path}] nested cookies(): ok`)
expect(logs).toContain(
`[${path}] connection(): error: Error: Route ${path} used \`connection()\` inside \`after()\`.`
`[${path}] nested cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] nested connection(): ok`)
......@@ -105,24 +108,27 @@ describe('nextjs APIs in after()', () => {
`[${path}] headers(): error: Error: Route ${path} used \`headers()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] nested headers(): ok`)
expect(logs).not.toContain(`[${path}] cookies(): ok`)
expect(logs).toContain(
`[${path}] nested headers(): error: Error: Route ${path} used \`headers()\` inside \`after()\`. This is not supported.`
`[${path}] cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] cookies(): ok`)
expect(logs).not.toContain(`[${path}] connection(): ok`)
expect(logs).toContain(
`[${path}] cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
`[${path}] connection(): error: Error: Route ${path} used \`connection()\` inside \`after()\`.`
)
})
await retry(() => {
const logs = isNextDev ? getLogs() : buildLogs // in `next start` the error was logged at build time
expect(logs).not.toContain(`[${path}] nested cookies(): ok`)
expect(logs).not.toContain(`[${path}] nested headers(): ok`)
expect(logs).toContain(
`[${path}] nested cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
`[${path}] nested headers(): error: Error: Route ${path} used \`headers()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] connection(): ok`)
expect(logs).not.toContain(`[${path}] nested cookies(): ok`)
expect(logs).toContain(
`[${path}] connection(): error: Error: Route ${path} used \`connection()\` inside \`after()\`.`
`[${path}] nested cookies(): error: Error: Route ${path} used \`cookies()\` inside \`after()\`. This is not supported.`
)
expect(logs).not.toContain(`[${path}] nested connection(): ok`)
......
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