test(ci): harden proxy-sensitive and timeout unit tests

This commit is contained in:
Vincent Koc
2026-04-04 02:11:45 +09:00
parent b871707628
commit f575bc2bfe
3 changed files with 40 additions and 18 deletions

View File

@@ -803,9 +803,22 @@ describe("update-cli", () => {
platformSpy.mockRestore();
expect(runGatewayUpdate).not.toHaveBeenCalled();
expect(runCommandWithTimeout).toHaveBeenCalledWith(
[brewNpm, "i", "-g", "openclaw@latest", "--no-fund", "--no-audit", "--loglevel=error"],
expect.any(Object),
const installCall = vi
.mocked(runCommandWithTimeout)
.mock.calls.find(
([argv]) =>
Array.isArray(argv) &&
path.normalize(String(argv[0] ?? "")) === path.normalize(brewNpm) &&
argv[1] === "i" &&
argv[2] === "-g" &&
argv[3] === "openclaw@latest",
);
expect(installCall).toBeDefined();
expect(installCall?.[1]).toEqual(
expect.objectContaining({
timeoutMs: expect.any(Number),
}),
);
});