test: tighten image tempdir cleanup assertion · openclaw/openclaw@3cf5b8f
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,6 +31,13 @@ describe("image-ops temp dir", () => {
|
31 | 31 | expect(prefix).toEqual(expect.stringMatching(/^.+openclaw-img-[0-9a-f-]+-$/u)); |
32 | 32 | expect(path.dirname(prefix ?? "")).toBe(secureRoot); |
33 | 33 | expect(createdTempDir.startsWith(prefix ?? "")).toBe(true); |
34 | | -await expect(fs.access(createdTempDir)).rejects.toMatchObject({ code: "ENOENT" }); |
| 34 | +let accessError: unknown; |
| 35 | +try { |
| 36 | +await fs.access(createdTempDir); |
| 37 | +} catch (error) { |
| 38 | +accessError = error; |
| 39 | +} |
| 40 | +expect(accessError).toBeInstanceOf(Error); |
| 41 | +expect((accessError as NodeJS.ErrnoException).code).toBe("ENOENT"); |
35 | 42 | }); |
36 | 43 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。