test: tighten backup archive absence assertion · openclaw/openclaw@e8049fe
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -55,6 +55,10 @@ describe("backupCreateCommand atomic archive write", () => {
|
55 | 55 | }; |
56 | 56 | } |
57 | 57 | |
| 58 | +async function expectPathMissing(targetPath: string): Promise<void> { |
| 59 | +await expect(fs.access(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 60 | +} |
| 61 | + |
58 | 62 | it("does not leave a partial final archive behind when tar creation fails", async () => { |
59 | 63 | const { archiveDir, outputPath, runtime } = await prepareAtomicBackupScenario({ |
60 | 64 | archivePrefix: "openclaw-backup-failure-", |
@@ -68,7 +72,7 @@ describe("backupCreateCommand atomic archive write", () => {
|
68 | 72 | }), |
69 | 73 | ).rejects.toThrow(/disk full/i); |
70 | 74 | |
71 | | -await expect(fs.access(outputPath)).rejects.toThrow(); |
| 75 | +await expectPathMissing(outputPath); |
72 | 76 | const remaining = await fs.readdir(archiveDir); |
73 | 77 | expect(remaining).toEqual([]); |
74 | 78 | } finally { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。