From a5182a2ef3ff1ad4e6b6adbc984dc26ccfadc00e Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:14:03 -0700 Subject: [PATCH] [js/web] update test condition for '--force-localhost' (#20450) ### Description Fixes the NPM packaging pipeline failure. --- js/web/script/test-runner-cli.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/web/script/test-runner-cli.ts b/js/web/script/test-runner-cli.ts index 03d637b35b..b67e173a22 100644 --- a/js/web/script/test-runner-cli.ts +++ b/js/web/script/test-runner-cli.ts @@ -558,7 +558,9 @@ async function main() { if (args.noSandbox) { karmaArgs.push('--no-sandbox'); } - if (webgpu || webnn) { + + // When using BrowserStack with Safari, we need NOT to use 'localhost' as the hostname. + if (!(browser.startsWith('BS_') && browser.includes('Safari'))) { karmaArgs.push('--force-localhost'); } if (webgpu) {