test: tighten update startup absence assertion · openclaw/openclaw@55439d8
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -151,6 +151,10 @@ describe("update-startup", () => {
|
151 | 151 | return { log, parsed }; |
152 | 152 | } |
153 | 153 | |
| 154 | +async function expectPathMissing(targetPath: string): Promise<void> { |
| 155 | +await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 156 | +} |
| 157 | + |
154 | 158 | function createAutoUpdateSuccessMock() { |
155 | 159 | return vi.fn().mockResolvedValue({ |
156 | 160 | ok: true, |
@@ -295,7 +299,7 @@ describe("update-startup", () => {
|
295 | 299 | }); |
296 | 300 | |
297 | 301 | expect(log.info).not.toHaveBeenCalled(); |
298 | | -await expect(fs.stat(path.join(tempDir, "update-check.json"))).rejects.toThrow(); |
| 302 | +await expectPathMissing(path.join(tempDir, "update-check.json")); |
299 | 303 | }); |
300 | 304 | |
301 | 305 | it("defers stable auto-update until rollout window is due", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。