Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use check on prerender test assertion #35482

Merged
merged 1 commit into from Mar 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 19 additions & 10 deletions test/e2e/prerender.test.ts
Expand Up @@ -1922,11 +1922,15 @@ describe('Prerender', () => {
expect(res.status).toBe(200)
}
await next.deleteFile('error.txt')
expect(
next.cliOutput.match(
/throwing error for \/blocking-fallback\/test-errors-1/
).length
).toBe(1)
await check(
() =>
next.cliOutput.match(
/throwing error for \/blocking-fallback\/test-errors-1/
).length === 1
? 'success'
: next.cliOutput,
'success'
)
})

it('should automatically reset cache TTL when an error occurs and runtime cache was available', async () => {
Expand All @@ -1947,11 +1951,16 @@ describe('Prerender', () => {
expect(res.status).toBe(200)
}
await next.deleteFile('error.txt')
expect(
next.cliOutput.match(
/throwing error for \/blocking-fallback\/test-errors-2/
).length
).toBe(1)

await check(
() =>
next.cliOutput.match(
/throwing error for \/blocking-fallback\/test-errors-2/
).length === 1
? 'success'
: next.cliOutput,
'success'
)
})

it('should handle manual revalidate for fallback: blocking', async () => {
Expand Down