Skip to content

Commit 33d5ebb

Browse files
committed
test(daemon): read launchd fixture files
1 parent 2a96ea4 commit 33d5ebb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/daemon/launchd.test.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ vi.mock("node:fs/promises", async () => {
249249
unlink: vi.fn(async (p: string) => {
250250
state.files.delete(p);
251251
}),
252+
readFile: vi.fn(async (p: string) => {
253+
const key = p;
254+
const data = state.files.get(key);
255+
if (data !== undefined) {
256+
return data;
257+
}
258+
throw new Error(`ENOENT: no such file or directory, read '${key}'`);
259+
}),
252260
writeFile: vi.fn(async (p: string, data: string, opts?: { mode?: number }) => {
253261
const key = p;
254262
state.files.set(key, data);
@@ -490,7 +498,6 @@ describe("launchd install", () => {
490498
const plistPath = resolveLaunchAgentPlistPath(env);
491499
state.serviceLoaded = false;
492500
state.kickstartError = "Could not find service";
493-
state.kickstartCode = 113;
494501
state.kickstartFailuresRemaining = 1;
495502
state.files.set(
496503
plistPath,

0 commit comments

Comments
 (0)