

























@@ -6,6 +6,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
66import type { CommandContext } from "../auto-reply/reply/commands-types.js";
77import { clearConfigCache } from "../config/config.js";
88import type { OpenClawConfig } from "../config/types.openclaw.js";
9+import { deleteTestEnvValue, setTestEnvValue } from "../test-utils/env.js";
910import { runCrestodianRescueMessage } from "./rescue-message.js";
10111112const originalStateDir = process.env.OPENCLAW_STATE_DIR;
@@ -54,22 +55,22 @@ describeLive("Crestodian live rescue channel smoke", () => {
5455afterEach(() => {
5556clearConfigCache();
5657if (originalStateDir === undefined) {
57-delete process.env.OPENCLAW_STATE_DIR;
58+deleteTestEnvValue("OPENCLAW_STATE_DIR");
5859} else {
59-process.env.OPENCLAW_STATE_DIR = originalStateDir;
60+setTestEnvValue("OPENCLAW_STATE_DIR", originalStateDir);
6061}
6162if (originalConfigPath === undefined) {
62-delete process.env.OPENCLAW_CONFIG_PATH;
63+deleteTestEnvValue("OPENCLAW_CONFIG_PATH");
6364} else {
64-process.env.OPENCLAW_CONFIG_PATH = originalConfigPath;
65+setTestEnvValue("OPENCLAW_CONFIG_PATH", originalConfigPath);
6566}
6667});
67686869it("handles /crestodian status and a persistent approval roundtrip", async () => {
6970const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-live-rescue-"));
7071const configPath = path.join(tempDir, "openclaw.json");
71-vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);
72-vi.stubEnv("OPENCLAW_CONFIG_PATH", configPath);
72+setTestEnvValue("OPENCLAW_STATE_DIR", tempDir);
73+setTestEnvValue("OPENCLAW_CONFIG_PATH", configPath);
7374await fs.writeFile(
7475configPath,
7576JSON.stringify(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。