mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-26 19:49:34 +00:00
test: preserve daemon coverage env scope
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user