test: verify cleanup dry run logs

This commit is contained in:
Shakker
2026-05-11 19:40:40 +01:00
parent 88673b2fad
commit a091a77dbd
+8 -8
View File
@@ -94,12 +94,10 @@ describe("cleanup path removals", () => {
{ dryRun: true },
);
const joinedLogs = runtime.log.mock.calls
.map(([line]) => line.replaceAll("\\", "/"))
.join("\n");
expect(joinedLogs).toContain("/tmp/openclaw-cleanup/state");
expect(joinedLogs).toContain("/tmp/openclaw-cleanup/oauth");
expect(joinedLogs).not.toContain("openclaw.json");
expect(runtime.log.mock.calls.map(([line]) => line.replaceAll("\\", "/"))).toEqual([
"[dry-run] remove /tmp/openclaw-cleanup/state",
"[dry-run] remove /tmp/openclaw-cleanup/oauth",
]);
});
it("removes every workspace directory", async () => {
@@ -109,7 +107,9 @@ describe("cleanup path removals", () => {
await removeWorkspaceDirs(workspaces, runtime, { dryRun: true });
const logs = runtime.log.mock.calls.map(([line]) => line);
expect(logs).toContain("[dry-run] remove /tmp/openclaw-workspace-1");
expect(logs).toContain("[dry-run] remove /tmp/openclaw-workspace-2");
expect(logs).toEqual([
"[dry-run] remove /tmp/openclaw-workspace-1",
"[dry-run] remove /tmp/openclaw-workspace-2",
]);
});
});