diff --git a/src/cli/daemon-cli.coverage.test.ts b/src/cli/daemon-cli.coverage.test.ts index a916cd3ea44..5e8b07e966f 100644 --- a/src/cli/daemon-cli.coverage.test.ts +++ b/src/cli/daemon-cli.coverage.test.ts @@ -4,7 +4,7 @@ import os from "node:os"; import path from "node:path"; import { Command } from "commander"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { captureEnv } from "../test-utils/env.js"; +import { captureEnv, deleteTestEnvValue, setTestEnvValue } from "../test-utils/env.js"; import { registerDaemonCli } from "./daemon-cli/register.js"; const probeGatewayStatus = vi.fn(async (..._args: unknown[]) => ({ ok: true })); @@ -191,10 +191,10 @@ describe("daemon-cli coverage", () => { "OPENCLAW_GATEWAY_PORT", "OPENCLAW_PROFILE", ]); - process.env.OPENCLAW_STATE_DIR = tmpDir; - process.env.OPENCLAW_CONFIG_PATH = path.join(tmpDir, "openclaw.json"); - delete process.env.OPENCLAW_GATEWAY_PORT; - delete process.env.OPENCLAW_PROFILE; + setTestEnvValue("OPENCLAW_STATE_DIR", tmpDir); + setTestEnvValue("OPENCLAW_CONFIG_PATH", path.join(tmpDir, "openclaw.json")); + deleteTestEnvValue("OPENCLAW_GATEWAY_PORT"); + deleteTestEnvValue("OPENCLAW_PROFILE"); serviceReadCommand.mockResolvedValue(null); resolveGatewayProbeAuthSafeWithSecretInputs.mockClear(); findExtraGatewayServices.mockClear();