From e37c078ea6b2a36b05848cb7e16d82924e84c014 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Fri, 4 Jun 2021 09:33:44 -0700 Subject: [PATCH] test(nonStallingRawEvaluateInExistingMainContext): fix broken test (#6908) --- tests/page/page-evaluate-no-stall.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/page/page-evaluate-no-stall.spec.ts b/tests/page/page-evaluate-no-stall.spec.ts index 6ac5594ec7..fdedbda275 100644 --- a/tests/page/page-evaluate-no-stall.spec.ts +++ b/tests/page/page-evaluate-no-stall.spec.ts @@ -44,8 +44,11 @@ test.describe('non-stalling evaluate', () => { }); await page.setContent(''); const error = await errorPromise; + // bail out if we accidentally succeeded + if (error === 4) + return; // Testing this as a race. - const success = error.message === 'Frame does not yet have a main execution context' || 'Frame is currently attempting a navigation'; + const success = error.message === 'Frame does not yet have a main execution context' || error.message === 'Frame is currently attempting a navigation'; expect(success).toBeTruthy(); }); });