test: tighten backup camera cleanup assertions · openclaw/openclaw@50898c4
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,10 @@ async function withCameraTempDir<T>(run: (dir: string) => Promise<T>): Promise<T
|
34 | 34 | return await withTempDir("openclaw-test-", run); |
35 | 35 | } |
36 | 36 | |
| 37 | +async function expectPathMissing(targetPath: string): Promise<void> { |
| 38 | +await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 39 | +} |
| 40 | + |
37 | 41 | describe("nodes camera helpers", () => { |
38 | 42 | beforeAll(async () => { |
39 | 43 | ({ |
@@ -240,7 +244,7 @@ describe("nodes camera helpers", () => {
|
240 | 244 | await expect( |
241 | 245 | writeUrlToFile(out, "https://198.51.100.42/broken.bin", { expectedHost: "198.51.100.42" }), |
242 | 246 | ).rejects.toThrow(/stream exploded/i); |
243 | | -await expect(fs.stat(out)).rejects.toThrow(); |
| 247 | +await expectPathMissing(out); |
244 | 248 | }); |
245 | 249 | }); |
246 | 250 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。