

























@@ -10,7 +10,7 @@ import { clearSessionStoreCacheForTest } from "../config/sessions/store.js";
1010import { resetAgentRunContextForTest } from "../infra/agent-events.js";
1111import { PROXY_ENV_KEYS } from "../infra/net/proxy-env.js";
1212import { clearGatewaySubagentRuntime } from "../plugins/runtime/index.js";
13-import { captureEnv } from "../test-utils/env.js";
13+import { captureEnv, deleteTestEnvValue, setTestEnvValue } from "../test-utils/env.js";
1414import { startGatewayServer } from "./server.js";
1515import { getFreeGatewayPort } from "./test-helpers.e2e.js";
1616@@ -76,12 +76,12 @@ describe("gateway network runtime", () => {
7676const testDispatcher = new Agent();
7777setGlobalDispatcher(testDispatcher);
7878for (const key of NETWORK_GATEWAY_ENV_KEYS) {
79-delete process.env[key];
79+deleteTestEnvValue(key);
8080}
8181process.env.HTTPS_PROXY = "http://127.0.0.1:9";
828283-process.env.HOME = tempHome;
84-process.env.OPENCLAW_STATE_DIR = path.join(tempHome, ".openclaw");
83+setTestEnvValue("HOME", tempHome);
84+setTestEnvValue("OPENCLAW_STATE_DIR", path.join(tempHome, ".openclaw"));
8585process.env.OPENCLAW_SKIP_CHANNELS = "1";
8686process.env.OPENCLAW_SKIP_GMAIL_WATCHER = "1";
8787process.env.OPENCLAW_SKIP_CRON = "1";
@@ -100,7 +100,7 @@ describe("gateway network runtime", () => {
100100configPath,
101101`${JSON.stringify({ gateway: { auth: { mode: "token", token } } }, null, 2)}\n`,
102102);
103-process.env.OPENCLAW_CONFIG_PATH = configPath;
103+setTestEnvValue("OPENCLAW_CONFIG_PATH", configPath);
104104105105server = await startGatewayServer(await getFreeGatewayPort(), {
106106bind: "loopback",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。