test: fix launchd restart mock state

This commit is contained in:
Peter Steinberger
2026-04-25 07:09:42 +01:00
parent 22aa402b64
commit 85cab8b516

View File

@@ -238,6 +238,14 @@ vi.mock("node:fs/promises", async () => {
}
throw new Error(`ENOENT: no such file or directory, chmod '${key}'`);
}),
readFile: vi.fn(async (p: string) => {
const key = p;
const data = state.files.get(key);
if (data !== undefined) {
return data;
}
throw new Error(`ENOENT: no such file or directory, open '${key}'`);
}),
unlink: vi.fn(async (p: string) => {
state.files.delete(p);
}),