mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 13:26:04 -06:00
test: verify cleanup dry run logs
This commit is contained in:
@@ -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",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user