mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 13:22:14 +00:00
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { beforeAll, describe, expect, it, vi } from "vitest";
|
|
|
|
const resolveGatewayLogPathsMock = vi.fn(() => ({
|
|
stdoutPath: "C:\\tmp\\openclaw-state\\logs\\gateway.log",
|
|
stderrPath: "C:\\tmp\\openclaw-state\\logs\\gateway.err.log",
|
|
}));
|
|
|
|
vi.mock("./launchd.js", () => ({
|
|
resolveGatewayLogPaths: resolveGatewayLogPathsMock,
|
|
}));
|
|
|
|
let buildPlatformRuntimeLogHints: typeof import("./runtime-hints.js").buildPlatformRuntimeLogHints;
|
|
|
|
describe("buildPlatformRuntimeLogHints", () => {
|
|
beforeAll(async () => {
|
|
({ buildPlatformRuntimeLogHints } = await import("./runtime-hints.js"));
|
|
});
|
|
|
|
it("strips windows drive prefixes from darwin display paths", () => {
|
|
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",
|
|
]);
|
|
});
|
|
});
|