MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / expectLaunchdInvariants

Function expectLaunchdInvariants

apps/cli/src/service.test.ts:71–85  ·  view source on GitHub ↗
(plist: string, input: typeof launchdInput)

Source from the content-addressed store, hash-verified

69 };
70
71 const expectLaunchdInvariants = (plist: string, input: typeof launchdInput): void => {
72 const programArguments = input.programArguments
73 .map((arg) => ` <string>${arg}</string>`)
74 .join("\n");
75
76 expect(plist).toContain("<key>Label</key>");
77 expect(plist).toContain(`<string>${input.label}</string>`);
78 expect(plist).toContain(
79 ` <key>ProgramArguments</key>\n <array>\n${programArguments}\n </array>`,
80 );
81 expect(plist).toMatch(/<key>RunAtLoad<\/key>\s*<true\/>/);
82 expect(plist).toMatch(
83 /<key>KeepAlive<\/key>\s*<dict>\s*<key>SuccessfulExit<\/key>\s*<false\/>\s*<\/dict>/,
84 );
85 };
86
87 it("renders a launchd plist that restarts on crash but not clean stop", () => {
88 const plist = generateLaunchdPlist(launchdInput);

Callers 1

service.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected