From 1d5add6d990e17f6e6f6a730e009bd162d969fcb Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 1 Jun 2023 23:11:03 -0700 Subject: [PATCH] test: fix `should not fulfill with redirect status` (#23459) --- tests/page/page-route.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/page/page-route.spec.ts b/tests/page/page-route.spec.ts index 3c348be70f..d9f8075b25 100644 --- a/tests/page/page-route.spec.ts +++ b/tests/page/page-route.spec.ts @@ -552,10 +552,10 @@ it('should not fulfill with redirect status', async ({ page, server, browserName }); for (status = 300; status < 310; status++) { - const exception = await Promise.race([ + const [, exception] = await Promise.all([ page.evaluate(url => location.href = url, server.PREFIX + '/redirect_this'), - new Promise((f, r) => {fulfill = f; reject = r;}) - ]) as any; + new Promise((f, r) => {fulfill = f; reject = r;}) + ]); expect(exception).toBeTruthy(); expect(exception.message.includes('Cannot fulfill with redirect status')).toBe(true); }