Files
openclaw/src/daemon/runtime-hints.windows-paths.test.ts
2026-03-07 21:46:34 +00:00

31 lines
953 B
TypeScript

import { afterEach, describe, expect, it, vi } from "vitest";
afterEach(() => {
vi.resetModules();
vi.doUnmock("./launchd.js");
});
describe("buildPlatformRuntimeLogHints", () => {
it("strips windows drive prefixes from darwin display paths", async () => {
vi.doMock("./launchd.js", () => ({
resolveGatewayLogPaths: () => ({
stdoutPath: "C:\\tmp\\openclaw-state\\logs\\gateway.log",
stderrPath: "C:\\tmp\\openclaw-state\\logs\\gateway.err.log",
}),
}));
const { buildPlatformRuntimeLogHints } = await import("./runtime-hints.js");
expect(
buildPlatformRuntimeLogHints({
platform: "darwin",
systemdServiceName: "openclaw-gateway",
windowsTaskName: "OpenClaw Gateway",
}),
).toEqual([
"Launchd stdout (if installed): /tmp/openclaw-state/logs/gateway.log",
"Launchd stderr (if installed): /tmp/openclaw-state/logs/gateway.err.log",
]);
});
});