mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 00:50:42 +00:00
test: tighten backup archive absence assertion
This commit is contained in:
@@ -55,6 +55,10 @@ describe("backupCreateCommand atomic archive write", () => {
|
||||
};
|
||||
}
|
||||
|
||||
async function expectPathMissing(targetPath: string): Promise<void> {
|
||||
await expect(fs.access(targetPath)).rejects.toMatchObject({ code: "ENOENT" });
|
||||
}
|
||||
|
||||
it("does not leave a partial final archive behind when tar creation fails", async () => {
|
||||
const { archiveDir, outputPath, runtime } = await prepareAtomicBackupScenario({
|
||||
archivePrefix: "openclaw-backup-failure-",
|
||||
@@ -68,7 +72,7 @@ describe("backupCreateCommand atomic archive write", () => {
|
||||
}),
|
||||
).rejects.toThrow(/disk full/i);
|
||||
|
||||
await expect(fs.access(outputPath)).rejects.toThrow();
|
||||
await expectPathMissing(outputPath);
|
||||
const remaining = await fs.readdir(archiveDir);
|
||||
expect(remaining).toEqual([]);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user