test: fix launchd restart mock state · openclaw/openclaw@85cab8b
steipete
·
2026-04-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -238,6 +238,14 @@ vi.mock("node:fs/promises", async () => {
|
238 | 238 | } |
239 | 239 | throw new Error(`ENOENT: no such file or directory, chmod '${key}'`); |
240 | 240 | }), |
| 241 | +readFile: vi.fn(async (p: string) => { |
| 242 | +const key = p; |
| 243 | +const data = state.files.get(key); |
| 244 | +if (data !== undefined) { |
| 245 | +return data; |
| 246 | +} |
| 247 | +throw new Error(`ENOENT: no such file or directory, open '${key}'`); |
| 248 | +}), |
241 | 249 | unlink: vi.fn(async (p: string) => { |
242 | 250 | state.files.delete(p); |
243 | 251 | }), |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。