[js/web] update test condition for '--force-localhost' (#20450)

### Description

Fixes the NPM packaging pipeline failure.
This commit is contained in:
Yulong Wang 2024-04-24 12:14:03 -07:00 committed by GitHub
parent 9cc5badc49
commit a5182a2ef3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {