diff --git a/test/e2e/prerender.test.ts b/test/e2e/prerender.test.ts index 0eeb864ed47b..6675da61aa66 100644 --- a/test/e2e/prerender.test.ts +++ b/test/e2e/prerender.test.ts @@ -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 () => { @@ -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 () => {