mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
655 lines
18 KiB
TypeScript
655 lines
18 KiB
TypeScript
import fs from "node:fs/promises";
|
|
import os from "node:os";
|
|
import path from "node:path";
|
|
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
import type { UpdateRunResult } from "../infra/update-runner.js";
|
|
|
|
const confirm = vi.fn();
|
|
const select = vi.fn();
|
|
const spinner = vi.fn(() => ({ start: vi.fn(), stop: vi.fn() }));
|
|
const isCancel = (value: unknown) => value === "cancel";
|
|
|
|
const readPackageName = vi.fn();
|
|
const readPackageVersion = vi.fn();
|
|
const resolveGlobalManager = vi.fn();
|
|
|
|
vi.mock("@clack/prompts", () => ({
|
|
confirm,
|
|
select,
|
|
isCancel,
|
|
spinner,
|
|
}));
|
|
|
|
// Mock the update-runner module
|
|
vi.mock("../infra/update-runner.js", () => ({
|
|
runGatewayUpdate: vi.fn(),
|
|
}));
|
|
|
|
vi.mock("../infra/openclaw-root.js", () => ({
|
|
resolveOpenClawPackageRoot: vi.fn(),
|
|
}));
|
|
|
|
vi.mock("../config/config.js", () => ({
|
|
readConfigFileSnapshot: vi.fn(),
|
|
writeConfigFile: vi.fn(),
|
|
}));
|
|
|
|
vi.mock("../infra/update-check.js", () => {
|
|
const parseSemver = (
|
|
value: string | null,
|
|
): { major: number; minor: number; patch: number } | null => {
|
|
if (!value) {
|
|
return null;
|
|
}
|
|
const m = /^(\d+)\.(\d+)\.(\d+)/.exec(value);
|
|
if (!m) {
|
|
return null;
|
|
}
|
|
const major = Number(m[1]);
|
|
const minor = Number(m[2]);
|
|
const patch = Number(m[3]);
|
|
if (!Number.isFinite(major) || !Number.isFinite(minor) || !Number.isFinite(patch)) {
|
|
return null;
|
|
}
|
|
return { major, minor, patch };
|
|
};
|
|
|
|
const compareSemverStrings = (a: string | null, b: string | null): number | null => {
|
|
const pa = parseSemver(a);
|
|
const pb = parseSemver(b);
|
|
if (!pa || !pb) {
|
|
return null;
|
|
}
|
|
if (pa.major !== pb.major) {
|
|
return pa.major < pb.major ? -1 : 1;
|
|
}
|
|
if (pa.minor !== pb.minor) {
|
|
return pa.minor < pb.minor ? -1 : 1;
|
|
}
|
|
if (pa.patch !== pb.patch) {
|
|
return pa.patch < pb.patch ? -1 : 1;
|
|
}
|
|
return 0;
|
|
};
|
|
|
|
return {
|
|
compareSemverStrings,
|
|
checkUpdateStatus: vi.fn(),
|
|
fetchNpmTagVersion: vi.fn(),
|
|
resolveNpmChannelTag: vi.fn(),
|
|
};
|
|
});
|
|
|
|
vi.mock("node:child_process", async () => {
|
|
const actual = await vi.importActual<typeof import("node:child_process")>("node:child_process");
|
|
return {
|
|
...actual,
|
|
spawnSync: vi.fn(() => ({
|
|
pid: 0,
|
|
output: [],
|
|
stdout: "",
|
|
stderr: "",
|
|
status: 0,
|
|
signal: null,
|
|
})),
|
|
};
|
|
});
|
|
|
|
vi.mock("../process/exec.js", () => ({
|
|
runCommandWithTimeout: vi.fn(),
|
|
}));
|
|
|
|
vi.mock("./update-cli/shared.js", async (importOriginal) => {
|
|
const actual = await importOriginal<typeof import("./update-cli/shared.js")>();
|
|
return {
|
|
...actual,
|
|
readPackageName,
|
|
readPackageVersion,
|
|
resolveGlobalManager,
|
|
};
|
|
});
|
|
|
|
// Mock doctor (heavy module; should not run in unit tests)
|
|
vi.mock("../commands/doctor.js", () => ({
|
|
doctorCommand: vi.fn(),
|
|
}));
|
|
// Mock the daemon-cli module
|
|
vi.mock("./daemon-cli.js", () => ({
|
|
runDaemonRestart: vi.fn(),
|
|
}));
|
|
|
|
// Mock the runtime
|
|
vi.mock("../runtime.js", () => ({
|
|
defaultRuntime: {
|
|
log: vi.fn(),
|
|
error: vi.fn(),
|
|
exit: vi.fn(),
|
|
},
|
|
}));
|
|
|
|
const { runGatewayUpdate } = await import("../infra/update-runner.js");
|
|
const { resolveOpenClawPackageRoot } = await import("../infra/openclaw-root.js");
|
|
const { readConfigFileSnapshot, writeConfigFile } = await import("../config/config.js");
|
|
const { checkUpdateStatus, fetchNpmTagVersion, resolveNpmChannelTag } =
|
|
await import("../infra/update-check.js");
|
|
const { runCommandWithTimeout } = await import("../process/exec.js");
|
|
const { runDaemonRestart } = await import("./daemon-cli.js");
|
|
const { defaultRuntime } = await import("../runtime.js");
|
|
const { updateCommand, registerUpdateCli, updateStatusCommand, updateWizardCommand } =
|
|
await import("./update-cli.js");
|
|
|
|
describe("update-cli", () => {
|
|
let fixtureRoot = "";
|
|
let fixtureCount = 0;
|
|
|
|
const createCaseDir = async (prefix: string) => {
|
|
const dir = path.join(fixtureRoot, `${prefix}-${fixtureCount++}`);
|
|
await fs.mkdir(dir, { recursive: true });
|
|
return dir;
|
|
};
|
|
|
|
beforeAll(async () => {
|
|
fixtureRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-update-tests-"));
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await fs.rm(fixtureRoot, { recursive: true, force: true });
|
|
});
|
|
|
|
const baseSnapshot = {
|
|
valid: true,
|
|
config: {},
|
|
issues: [],
|
|
} as const;
|
|
|
|
const setTty = (value: boolean | undefined) => {
|
|
Object.defineProperty(process.stdin, "isTTY", {
|
|
value,
|
|
configurable: true,
|
|
});
|
|
};
|
|
|
|
const setStdoutTty = (value: boolean | undefined) => {
|
|
Object.defineProperty(process.stdout, "isTTY", {
|
|
value,
|
|
configurable: true,
|
|
});
|
|
};
|
|
|
|
beforeEach(() => {
|
|
confirm.mockReset();
|
|
select.mockReset();
|
|
vi.mocked(runGatewayUpdate).mockReset();
|
|
vi.mocked(resolveOpenClawPackageRoot).mockReset();
|
|
vi.mocked(readConfigFileSnapshot).mockReset();
|
|
vi.mocked(writeConfigFile).mockReset();
|
|
vi.mocked(checkUpdateStatus).mockReset();
|
|
vi.mocked(fetchNpmTagVersion).mockReset();
|
|
vi.mocked(resolveNpmChannelTag).mockReset();
|
|
vi.mocked(runCommandWithTimeout).mockReset();
|
|
vi.mocked(runDaemonRestart).mockReset();
|
|
vi.mocked(defaultRuntime.log).mockReset();
|
|
vi.mocked(defaultRuntime.error).mockReset();
|
|
vi.mocked(defaultRuntime.exit).mockReset();
|
|
readPackageName.mockReset();
|
|
readPackageVersion.mockReset();
|
|
resolveGlobalManager.mockReset();
|
|
vi.mocked(resolveOpenClawPackageRoot).mockResolvedValue(process.cwd());
|
|
vi.mocked(readConfigFileSnapshot).mockResolvedValue(baseSnapshot);
|
|
vi.mocked(fetchNpmTagVersion).mockResolvedValue({
|
|
tag: "latest",
|
|
version: "9999.0.0",
|
|
});
|
|
vi.mocked(resolveNpmChannelTag).mockResolvedValue({
|
|
tag: "latest",
|
|
version: "9999.0.0",
|
|
});
|
|
vi.mocked(checkUpdateStatus).mockResolvedValue({
|
|
root: "/test/path",
|
|
installKind: "git",
|
|
packageManager: "pnpm",
|
|
git: {
|
|
root: "/test/path",
|
|
sha: "abcdef1234567890",
|
|
tag: "v1.2.3",
|
|
branch: "main",
|
|
upstream: "origin/main",
|
|
dirty: false,
|
|
ahead: 0,
|
|
behind: 0,
|
|
fetchOk: true,
|
|
},
|
|
deps: {
|
|
manager: "pnpm",
|
|
status: "ok",
|
|
lockfilePath: "/test/path/pnpm-lock.yaml",
|
|
markerPath: "/test/path/node_modules",
|
|
},
|
|
registry: {
|
|
latestVersion: "1.2.3",
|
|
},
|
|
});
|
|
vi.mocked(runCommandWithTimeout).mockResolvedValue({
|
|
stdout: "",
|
|
stderr: "",
|
|
code: 0,
|
|
signal: null,
|
|
killed: false,
|
|
});
|
|
readPackageName.mockResolvedValue("openclaw");
|
|
readPackageVersion.mockResolvedValue("1.0.0");
|
|
resolveGlobalManager.mockResolvedValue("npm");
|
|
setTty(false);
|
|
setStdoutTty(false);
|
|
});
|
|
|
|
it("exports updateCommand and registerUpdateCli", async () => {
|
|
expect(typeof updateCommand).toBe("function");
|
|
expect(typeof registerUpdateCli).toBe("function");
|
|
expect(typeof updateWizardCommand).toBe("function");
|
|
}, 20_000);
|
|
|
|
it("updateCommand runs update and outputs result", async () => {
|
|
const mockResult: UpdateRunResult = {
|
|
status: "ok",
|
|
mode: "git",
|
|
root: "/test/path",
|
|
before: { sha: "abc123", version: "1.0.0" },
|
|
after: { sha: "def456", version: "1.0.1" },
|
|
steps: [
|
|
{
|
|
name: "git fetch",
|
|
command: "git fetch",
|
|
cwd: "/test/path",
|
|
durationMs: 100,
|
|
exitCode: 0,
|
|
},
|
|
],
|
|
durationMs: 500,
|
|
};
|
|
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
|
|
|
|
await updateCommand({ json: false });
|
|
|
|
expect(runGatewayUpdate).toHaveBeenCalled();
|
|
expect(defaultRuntime.log).toHaveBeenCalled();
|
|
});
|
|
|
|
it("updateStatusCommand prints table output", async () => {
|
|
await updateStatusCommand({ json: false });
|
|
|
|
const logs = vi.mocked(defaultRuntime.log).mock.calls.map((call) => call[0]);
|
|
expect(logs.join("\n")).toContain("OpenClaw update status");
|
|
});
|
|
|
|
it("updateStatusCommand emits JSON", async () => {
|
|
await updateStatusCommand({ json: true });
|
|
|
|
const last = vi.mocked(defaultRuntime.log).mock.calls.at(-1)?.[0];
|
|
expect(typeof last).toBe("string");
|
|
const parsed = JSON.parse(String(last));
|
|
expect(parsed.channel.value).toBe("stable");
|
|
});
|
|
|
|
it("defaults to dev channel for git installs when unset", async () => {
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
|
|
await updateCommand({});
|
|
|
|
const call = vi.mocked(runGatewayUpdate).mock.calls[0]?.[0];
|
|
expect(call?.channel).toBe("dev");
|
|
});
|
|
|
|
it("defaults to stable channel for package installs when unset", async () => {
|
|
const tempDir = await createCaseDir("openclaw-update");
|
|
|
|
vi.mocked(resolveOpenClawPackageRoot).mockResolvedValue(tempDir);
|
|
vi.mocked(checkUpdateStatus).mockResolvedValue({
|
|
root: tempDir,
|
|
installKind: "package",
|
|
packageManager: "npm",
|
|
deps: {
|
|
manager: "npm",
|
|
status: "ok",
|
|
lockfilePath: null,
|
|
markerPath: null,
|
|
},
|
|
});
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "npm",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
|
|
await updateCommand({ yes: true });
|
|
|
|
const call = vi.mocked(runGatewayUpdate).mock.calls[0]?.[0];
|
|
expect(call?.channel).toBe("stable");
|
|
expect(call?.tag).toBe("latest");
|
|
});
|
|
|
|
it("uses stored beta channel when configured", async () => {
|
|
vi.mocked(readConfigFileSnapshot).mockResolvedValue({
|
|
...baseSnapshot,
|
|
config: { update: { channel: "beta" } },
|
|
});
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
|
|
await updateCommand({});
|
|
|
|
const call = vi.mocked(runGatewayUpdate).mock.calls[0]?.[0];
|
|
expect(call?.channel).toBe("beta");
|
|
});
|
|
|
|
it("falls back to latest when beta tag is older than release", async () => {
|
|
const tempDir = await createCaseDir("openclaw-update");
|
|
|
|
vi.mocked(resolveOpenClawPackageRoot).mockResolvedValue(tempDir);
|
|
vi.mocked(readConfigFileSnapshot).mockResolvedValue({
|
|
...baseSnapshot,
|
|
config: { update: { channel: "beta" } },
|
|
});
|
|
vi.mocked(checkUpdateStatus).mockResolvedValue({
|
|
root: tempDir,
|
|
installKind: "package",
|
|
packageManager: "npm",
|
|
deps: {
|
|
manager: "npm",
|
|
status: "ok",
|
|
lockfilePath: null,
|
|
markerPath: null,
|
|
},
|
|
});
|
|
vi.mocked(resolveNpmChannelTag).mockResolvedValue({
|
|
tag: "latest",
|
|
version: "1.2.3-1",
|
|
});
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "npm",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
|
|
await updateCommand({});
|
|
|
|
const call = vi.mocked(runGatewayUpdate).mock.calls[0]?.[0];
|
|
expect(call?.channel).toBe("beta");
|
|
expect(call?.tag).toBe("latest");
|
|
});
|
|
|
|
it("honors --tag override", async () => {
|
|
const tempDir = await createCaseDir("openclaw-update");
|
|
|
|
vi.mocked(resolveOpenClawPackageRoot).mockResolvedValue(tempDir);
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "npm",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
|
|
await updateCommand({ tag: "next" });
|
|
|
|
const call = vi.mocked(runGatewayUpdate).mock.calls[0]?.[0];
|
|
expect(call?.tag).toBe("next");
|
|
});
|
|
|
|
it("updateCommand outputs JSON when --json is set", async () => {
|
|
const mockResult: UpdateRunResult = {
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
};
|
|
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
|
|
vi.mocked(defaultRuntime.log).mockClear();
|
|
|
|
await updateCommand({ json: true });
|
|
|
|
const logCalls = vi.mocked(defaultRuntime.log).mock.calls;
|
|
const jsonOutput = logCalls.find((call) => {
|
|
try {
|
|
JSON.parse(call[0] as string);
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
});
|
|
expect(jsonOutput).toBeDefined();
|
|
});
|
|
|
|
it("updateCommand exits with error on failure", async () => {
|
|
const mockResult: UpdateRunResult = {
|
|
status: "error",
|
|
mode: "git",
|
|
reason: "rebase-failed",
|
|
steps: [],
|
|
durationMs: 100,
|
|
};
|
|
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
|
|
vi.mocked(defaultRuntime.exit).mockClear();
|
|
|
|
await updateCommand({});
|
|
|
|
expect(defaultRuntime.exit).toHaveBeenCalledWith(1);
|
|
});
|
|
|
|
it("updateCommand restarts daemon by default", async () => {
|
|
const mockResult: UpdateRunResult = {
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
};
|
|
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
|
|
vi.mocked(runDaemonRestart).mockResolvedValue(true);
|
|
|
|
await updateCommand({});
|
|
|
|
expect(runDaemonRestart).toHaveBeenCalled();
|
|
});
|
|
|
|
it("updateCommand skips restart when --no-restart is set", async () => {
|
|
const mockResult: UpdateRunResult = {
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
};
|
|
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
|
|
|
|
await updateCommand({ restart: false });
|
|
|
|
expect(runDaemonRestart).not.toHaveBeenCalled();
|
|
});
|
|
|
|
it("updateCommand skips success message when restart does not run", async () => {
|
|
const mockResult: UpdateRunResult = {
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
};
|
|
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
|
|
vi.mocked(runDaemonRestart).mockResolvedValue(false);
|
|
vi.mocked(defaultRuntime.log).mockClear();
|
|
|
|
await updateCommand({ restart: true });
|
|
|
|
const logLines = vi.mocked(defaultRuntime.log).mock.calls.map((call) => String(call[0]));
|
|
expect(logLines.some((line) => line.includes("Daemon restarted successfully."))).toBe(false);
|
|
});
|
|
|
|
it("updateCommand validates timeout option", async () => {
|
|
vi.mocked(defaultRuntime.error).mockClear();
|
|
vi.mocked(defaultRuntime.exit).mockClear();
|
|
|
|
await updateCommand({ timeout: "invalid" });
|
|
|
|
expect(defaultRuntime.error).toHaveBeenCalledWith(expect.stringContaining("timeout"));
|
|
expect(defaultRuntime.exit).toHaveBeenCalledWith(1);
|
|
});
|
|
|
|
it("persists update channel when --channel is set", async () => {
|
|
const mockResult: UpdateRunResult = {
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
};
|
|
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
|
|
|
|
await updateCommand({ channel: "beta" });
|
|
|
|
expect(writeConfigFile).toHaveBeenCalled();
|
|
const call = vi.mocked(writeConfigFile).mock.calls[0]?.[0] as {
|
|
update?: { channel?: string };
|
|
};
|
|
expect(call?.update?.channel).toBe("beta");
|
|
});
|
|
|
|
it("requires confirmation on downgrade when non-interactive", async () => {
|
|
const tempDir = await createCaseDir("openclaw-update");
|
|
setTty(false);
|
|
readPackageVersion.mockResolvedValue("2.0.0");
|
|
|
|
vi.mocked(resolveOpenClawPackageRoot).mockResolvedValue(tempDir);
|
|
vi.mocked(checkUpdateStatus).mockResolvedValue({
|
|
root: tempDir,
|
|
installKind: "package",
|
|
packageManager: "npm",
|
|
deps: {
|
|
manager: "npm",
|
|
status: "ok",
|
|
lockfilePath: null,
|
|
markerPath: null,
|
|
},
|
|
});
|
|
vi.mocked(resolveNpmChannelTag).mockResolvedValue({
|
|
tag: "latest",
|
|
version: "0.0.1",
|
|
});
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "npm",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
vi.mocked(defaultRuntime.error).mockClear();
|
|
vi.mocked(defaultRuntime.exit).mockClear();
|
|
|
|
await updateCommand({});
|
|
|
|
expect(defaultRuntime.error).toHaveBeenCalledWith(
|
|
expect.stringContaining("Downgrade confirmation required."),
|
|
);
|
|
expect(defaultRuntime.exit).toHaveBeenCalledWith(1);
|
|
});
|
|
|
|
it("allows downgrade with --yes in non-interactive mode", async () => {
|
|
const tempDir = await createCaseDir("openclaw-update");
|
|
setTty(false);
|
|
readPackageVersion.mockResolvedValue("2.0.0");
|
|
|
|
vi.mocked(resolveOpenClawPackageRoot).mockResolvedValue(tempDir);
|
|
vi.mocked(checkUpdateStatus).mockResolvedValue({
|
|
root: tempDir,
|
|
installKind: "package",
|
|
packageManager: "npm",
|
|
deps: {
|
|
manager: "npm",
|
|
status: "ok",
|
|
lockfilePath: null,
|
|
markerPath: null,
|
|
},
|
|
});
|
|
vi.mocked(resolveNpmChannelTag).mockResolvedValue({
|
|
tag: "latest",
|
|
version: "0.0.1",
|
|
});
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "npm",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
vi.mocked(defaultRuntime.error).mockClear();
|
|
vi.mocked(defaultRuntime.exit).mockClear();
|
|
|
|
await updateCommand({ yes: true });
|
|
|
|
expect(defaultRuntime.error).not.toHaveBeenCalledWith(
|
|
expect.stringContaining("Downgrade confirmation required."),
|
|
);
|
|
expect(runGatewayUpdate).toHaveBeenCalled();
|
|
});
|
|
|
|
it("updateWizardCommand requires a TTY", async () => {
|
|
setTty(false);
|
|
vi.mocked(defaultRuntime.error).mockClear();
|
|
vi.mocked(defaultRuntime.exit).mockClear();
|
|
|
|
await updateWizardCommand({});
|
|
|
|
expect(defaultRuntime.error).toHaveBeenCalledWith(
|
|
expect.stringContaining("Update wizard requires a TTY"),
|
|
);
|
|
expect(defaultRuntime.exit).toHaveBeenCalledWith(1);
|
|
});
|
|
|
|
it("updateWizardCommand offers dev checkout and forwards selections", async () => {
|
|
const tempDir = await createCaseDir("openclaw-update-wizard");
|
|
const previousGitDir = process.env.OPENCLAW_GIT_DIR;
|
|
try {
|
|
setTty(true);
|
|
process.env.OPENCLAW_GIT_DIR = tempDir;
|
|
|
|
vi.mocked(checkUpdateStatus).mockResolvedValue({
|
|
root: "/test/path",
|
|
installKind: "package",
|
|
packageManager: "npm",
|
|
deps: {
|
|
manager: "npm",
|
|
status: "ok",
|
|
lockfilePath: null,
|
|
markerPath: null,
|
|
},
|
|
});
|
|
select.mockResolvedValue("dev");
|
|
confirm.mockResolvedValueOnce(true).mockResolvedValueOnce(false);
|
|
vi.mocked(runGatewayUpdate).mockResolvedValue({
|
|
status: "ok",
|
|
mode: "git",
|
|
steps: [],
|
|
durationMs: 100,
|
|
});
|
|
|
|
await updateWizardCommand({});
|
|
|
|
const call = vi.mocked(runGatewayUpdate).mock.calls[0]?.[0];
|
|
expect(call?.channel).toBe("dev");
|
|
} finally {
|
|
process.env.OPENCLAW_GIT_DIR = previousGitDir;
|
|
}
|
|
});
|
|
});
|