From 129a45d2a51eed6afb44dc149d9e0cc304b72c73 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 18 Sep 2024 18:04:03 +0200 Subject: [PATCH] test: fix client-certificate tests --- tests/library/client-certificates.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/library/client-certificates.spec.ts b/tests/library/client-certificates.spec.ts index 4981d5cad74d2..5f0321526a6f8 100644 --- a/tests/library/client-certificates.spec.ts +++ b/tests/library/client-certificates.spec.ts @@ -365,7 +365,8 @@ test.describe('browser', () => { }); expect(proxyServer.connectHosts).toEqual([]); await page.goto(serverURL); - expect([...new Set(proxyServer.connectHosts)]).toEqual([`127.0.0.1:${new URL(serverURL).port}`]); + const host = browserName === 'webkit' && process.platform === 'darwin' ? 'localhost' : '127.0.0.1'; + expect([...new Set(proxyServer.connectHosts)]).toEqual([`${host}:${new URL(serverURL).port}`]); await expect(page.getByTestId('message')).toHaveText('Hello Alice, your certificate was issued by localhost!'); await page.close(); }); @@ -389,7 +390,8 @@ test.describe('browser', () => { }); expect(connectHosts).toEqual([]); await page.goto(serverURL); - expect(connectHosts).toEqual([`127.0.0.1:${serverPort}`]); + const host = browserName === 'webkit' && process.platform === 'darwin' ? 'localhost' : '127.0.0.1'; + expect(connectHosts).toEqual([`${host}:${serverPort}`]); await expect(page.getByTestId('message')).toHaveText('Hello Alice, your certificate was issued by localhost!'); await page.close(); await closeProxyServer();