






















@@ -5,6 +5,7 @@ import os from "node:os";
55import path from "node:path";
66import { afterAll, beforeAll, describe, expect, it } from "vitest";
77import type { callGateway as gatewayCall } from "../../gateway/call.js";
8+import { deleteTestEnvValue, setTestEnvValue } from "../../test-utils/env.js";
89910type CallGatewayRequest = Parameters<typeof gatewayCall>[0];
1011@@ -18,7 +19,7 @@ function useLoggingConfig(name: string, logging: Record<string, unknown>): void
1819}
1920const configPath = path.join(tempDir, name);
2021fs.writeFileSync(configPath, `${JSON.stringify({ logging })}\n`, "utf8");
21-process.env.OPENCLAW_CONFIG_PATH = configPath;
22+setTestEnvValue("OPENCLAW_CONFIG_PATH", configPath);
2223}
23242425function createHistoryToolWithMessage(content: string) {
@@ -50,9 +51,9 @@ describe("sessions_history redaction", () => {
50515152afterAll(() => {
5253if (previousConfigPath === undefined) {
53-delete process.env.OPENCLAW_CONFIG_PATH;
54+deleteTestEnvValue("OPENCLAW_CONFIG_PATH");
5455} else {
55-process.env.OPENCLAW_CONFIG_PATH = previousConfigPath;
56+setTestEnvValue("OPENCLAW_CONFIG_PATH", previousConfigPath);
5657}
5758if (tempDir) {
5859fs.rmSync(tempDir, { recursive: true, force: true });
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。