Skip to content

Commit

Permalink
Use check on prerender test assertion (vercel#35482)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Mar 21, 2022
1 parent 40a5c94 commit da3760b
Showing 1 changed file with 19 additions and 10 deletions.
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

0 comments on commit da3760b

Please sign in to comment.