Skip to content

Commit 84425b7

Browse files
committed
Fix proxy environment handling
1 parent 021a7d9 commit 84425b7

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

tests/classes/CLITestRunner.class.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class CLITestRunner {
1717
os.platform() !== "win32"
1818
? []
1919
: ["-ExecutionPolicy", "Bypass", "-NoProfile"];
20-
this.environment = { ...process.env };
2120
}
2221

2322
async runIDFTerminal(loadScript, timeout = 3000) {
@@ -54,7 +53,7 @@ class CLITestRunner {
5453
cols: 80,
5554
rows: 30,
5655
cwd: process.cwd(),
57-
env: this.environment,
56+
env: process.env,
5857
});
5958
this.exited = false;
6059

tests/classes/TestProxy.class.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@ class TestProxy {
2424
setEnvironment() {
2525
logger.info("Setting proxy environment variables");
2626
const proxyUrl = "http://127.0.0.1:8888";
27-
let environment = { ...process.env };
28-
environment.HTTP_PROXY = proxyUrl;
29-
environment.HTTPS_PROXY = proxyUrl;
30-
environment.http_proxy = proxyUrl;
31-
environment.https_proxy = proxyUrl;
32-
environment.FTP_PROXY = proxyUrl;
33-
environment.ftp_proxy = proxyUrl;
34-
environment.NO_PROXY = "127.0.0.1,localhost,::1";
35-
environment.no_proxy = "127.0.0.1,localhost,::1";
36-
environment.CARGO_HTTP_PROXY = proxyUrl;
37-
environment.CARGO_HTTPS_PROXY = proxyUrl;
38-
environment.GIT_PROXY_COMMAND = "";
39-
environment.npm_config_proxy = proxyUrl;
40-
environment.npm_config_https_proxy = proxyUrl;
41-
environment.PIP_PROXY = proxyUrl;
42-
process.env = { ...environment };
27+
process.env.HTTP_PROXY = proxyUrl;
28+
process.env.HTTPS_PROXY = proxyUrl;
29+
process.env.http_proxy = proxyUrl;
30+
process.env.https_proxy = proxyUrl;
31+
process.env.FTP_PROXY = proxyUrl;
32+
process.env.ftp_proxy = proxyUrl;
33+
process.env.NO_PROXY = "127.0.0.1,localhost,::1";
34+
process.env.no_proxy = "127.0.0.1,localhost,::1";
35+
process.env.CARGO_HTTP_PROXY = proxyUrl;
36+
process.env.CARGO_HTTPS_PROXY = proxyUrl;
37+
process.env.GIT_PROXY_COMMAND = "";
38+
process.env.npm_config_proxy = proxyUrl;
39+
process.env.npm_config_https_proxy = proxyUrl;
40+
process.env.PIP_PROXY = proxyUrl;
4341
}
4442

4543
async start() {

0 commit comments

Comments
 (0)