Skip to content

Commit 9c4bd94

Browse files
committed
Fix flaky getSocketCliApiProxy test on CI runners
The test expected undefined when SOCKET_CLI_API_PROXY is unset, but getSocketCliApiProxy falls back to standard proxy env vars (HTTPS_PROXY, HTTP_PROXY, etc.) which CI runners set. Clear all fallback vars in the test to ensure isolation.
1 parent 504fe06 commit 9c4bd94

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/unit/env/socket-cli.test.mts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ describe('socket-cli env', () => {
6565
})
6666

6767
it('should return undefined when not set', () => {
68+
// Clear all proxy env vars that getSocketCliApiProxy falls back to,
69+
// including standard proxy vars that CI runners may have set.
6870
setEnv('SOCKET_CLI_API_PROXY', undefined)
71+
setEnv('SOCKET_SECURITY_API_PROXY', undefined)
72+
setEnv('HTTPS_PROXY', undefined)
73+
setEnv('https_proxy', undefined)
74+
setEnv('HTTP_PROXY', undefined)
75+
setEnv('http_proxy', undefined)
6976
expect(getSocketCliApiProxy()).toBeUndefined()
7077
})
7178
})

0 commit comments

Comments
 (0)