mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 11:25:50 -06:00
895b691c55
* fix(daemon): block duplicate launchd owners Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com> * fix(ci): satisfy launchd docs and lint gates * fix(ci): remove unused launchd exports * docs: refresh gateway map --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
23 lines
880 B
TypeScript
23 lines
880 B
TypeScript
// Launchd label tests keep lifecycle, handoff, update, and discovery resolution aligned.
|
|
import { describe, expect, it } from "vitest";
|
|
import { resolveLaunchAgentLabel } from "./launchd-label.js";
|
|
|
|
describe("resolveLaunchAgentLabel", () => {
|
|
it("resolves default, profile, and explicit labels", () => {
|
|
expect(resolveLaunchAgentLabel()).toBe("ai.openclaw.gateway");
|
|
expect(resolveLaunchAgentLabel({ OPENCLAW_PROFILE: "work" })).toBe("ai.openclaw.work");
|
|
expect(
|
|
resolveLaunchAgentLabel({
|
|
OPENCLAW_PROFILE: "work",
|
|
OPENCLAW_LAUNCHD_LABEL: "com.example.gateway",
|
|
}),
|
|
).toBe("com.example.gateway");
|
|
});
|
|
|
|
it("rejects labels that cannot be passed safely to launchd", () => {
|
|
expect(() =>
|
|
resolveLaunchAgentLabel({ OPENCLAW_LAUNCHD_LABEL: "ai.openclaw.$(echo injected)" }),
|
|
).toThrow("Invalid launchd label");
|
|
});
|
|
});
|