mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:01:25 +00:00
refactor: centralize daemon path resolution
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
GATEWAY_SYSTEMD_SERVICE_NAME,
|
||||
GATEWAY_WINDOWS_TASK_NAME,
|
||||
resolveGatewayLaunchAgentLabel,
|
||||
resolveGatewayProfileSuffix,
|
||||
resolveGatewaySystemdServiceName,
|
||||
resolveGatewayWindowsTaskName,
|
||||
} from "./constants.js";
|
||||
@@ -153,6 +154,25 @@ describe("resolveGatewayWindowsTaskName", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveGatewayProfileSuffix", () => {
|
||||
it("returns empty string when no profile is set", () => {
|
||||
expect(resolveGatewayProfileSuffix()).toBe("");
|
||||
});
|
||||
|
||||
it("returns empty string for default profiles", () => {
|
||||
expect(resolveGatewayProfileSuffix("default")).toBe("");
|
||||
expect(resolveGatewayProfileSuffix(" Default ")).toBe("");
|
||||
});
|
||||
|
||||
it("returns a hyphenated suffix for custom profiles", () => {
|
||||
expect(resolveGatewayProfileSuffix("dev")).toBe("-dev");
|
||||
});
|
||||
|
||||
it("trims whitespace from profiles", () => {
|
||||
expect(resolveGatewayProfileSuffix(" staging ")).toBe("-staging");
|
||||
});
|
||||
});
|
||||
|
||||
describe("formatGatewayServiceDescription", () => {
|
||||
it("returns default description when no profile/version", () => {
|
||||
expect(formatGatewayServiceDescription()).toBe("Clawdbot Gateway");
|
||||
|
||||
Reference in New Issue
Block a user