@@ -4,7 +4,7 @@ import os from "node:os";
44import path from "node:path" ;
55import { Command } from "commander" ;
66import { afterEach , beforeEach , describe , expect , it , vi } from "vitest" ;
7- import { captureEnv } from "../test-utils/env.js" ;
7+ import { captureEnv , deleteTestEnvValue , setTestEnvValue } from "../test-utils/env.js" ;
88import { registerDaemonCli } from "./daemon-cli/register.js" ;
99
1010const probeGatewayStatus = vi . fn ( async ( ..._args : unknown [ ] ) => ( { ok : true } ) ) ;
@@ -191,10 +191,10 @@ describe("daemon-cli coverage", () => {
191191 "OPENCLAW_GATEWAY_PORT" ,
192192 "OPENCLAW_PROFILE" ,
193193 ] ) ;
194- process . env . OPENCLAW_STATE_DIR = tmpDir ;
195- process . env . OPENCLAW_CONFIG_PATH = path . join ( tmpDir , "openclaw.json" ) ;
196- delete process . env . OPENCLAW_GATEWAY_PORT ;
197- delete process . env . OPENCLAW_PROFILE ;
194+ setTestEnvValue ( " OPENCLAW_STATE_DIR" , tmpDir ) ;
195+ setTestEnvValue ( " OPENCLAW_CONFIG_PATH" , path . join ( tmpDir , "openclaw.json" ) ) ;
196+ deleteTestEnvValue ( " OPENCLAW_GATEWAY_PORT" ) ;
197+ deleteTestEnvValue ( " OPENCLAW_PROFILE" ) ;
198198 serviceReadCommand . mockResolvedValue ( null ) ;
199199 resolveGatewayProbeAuthSafeWithSecretInputs . mockClear ( ) ;
200200 findExtraGatewayServices . mockClear ( ) ;
0 commit comments