test: preserve daemon coverage env scope · openclaw/openclaw@d693b70
shakkernerd
·
2026-06-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@ import os from "node:os";
|
4 | 4 | import path from "node:path"; |
5 | 5 | import { Command } from "commander"; |
6 | 6 | import { 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"; |
8 | 8 | import { registerDaemonCli } from "./daemon-cli/register.js"; |
9 | 9 | |
10 | 10 | const probeGatewayStatus = vi.fn(async (..._args: unknown[]) => ({ ok: true })); |
@@ -191,10 +191,10 @@ describe("daemon-cli coverage", () => {
|
191 | 191 | "OPENCLAW_GATEWAY_PORT", |
192 | 192 | "OPENCLAW_PROFILE", |
193 | 193 | ]); |
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"); |
198 | 198 | serviceReadCommand.mockResolvedValue(null); |
199 | 199 | resolveGatewayProbeAuthSafeWithSecretInputs.mockClear(); |
200 | 200 | findExtraGatewayServices.mockClear(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。