Unverified Commit da3760bb authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Use check on prerender test assertion (#35482)

parent 40a5c94c
...@@ -1922,11 +1922,15 @@ describe('Prerender', () => { ...@@ -1922,11 +1922,15 @@ describe('Prerender', () => {
expect(res.status).toBe(200) expect(res.status).toBe(200)
} }
await next.deleteFile('error.txt') await next.deleteFile('error.txt')
expect( await check(
next.cliOutput.match( () =>
/throwing error for \/blocking-fallback\/test-errors-1/ next.cliOutput.match(
).length /throwing error for \/blocking-fallback\/test-errors-1/
).toBe(1) ).length === 1
? 'success'
: next.cliOutput,
'success'
)
}) })
it('should automatically reset cache TTL when an error occurs and runtime cache was available', async () => { it('should automatically reset cache TTL when an error occurs and runtime cache was available', async () => {
...@@ -1947,11 +1951,16 @@ describe('Prerender', () => { ...@@ -1947,11 +1951,16 @@ describe('Prerender', () => {
expect(res.status).toBe(200) expect(res.status).toBe(200)
} }
await next.deleteFile('error.txt') await next.deleteFile('error.txt')
expect(
next.cliOutput.match( await check(
/throwing error for \/blocking-fallback\/test-errors-2/ () =>
).length next.cliOutput.match(
).toBe(1) /throwing error for \/blocking-fallback\/test-errors-2/
).length === 1
? 'success'
: next.cliOutput,
'success'
)
}) })
it('should handle manual revalidate for fallback: blocking', async () => { it('should handle manual revalidate for fallback: blocking', async () => {
......
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