mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:41:37 +00:00
test: remove redundant rotate timestamp case
This commit is contained in:
@@ -216,19 +216,4 @@ describe("rotateSessionFile", () => {
|
|||||||
|
|
||||||
expect(bakFiles.length).toBeLessThanOrEqual(3);
|
expect(bakFiles.length).toBeLessThanOrEqual(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("backup file name includes a timestamp", async () => {
|
|
||||||
await fs.writeFile(storePath, "x".repeat(100), "utf-8");
|
|
||||||
const before = Date.now();
|
|
||||||
|
|
||||||
await rotateSessionFile(storePath, 50);
|
|
||||||
|
|
||||||
const after = Date.now();
|
|
||||||
const files = await fs.readdir(testDir);
|
|
||||||
const bakFiles = files.filter((f) => f.startsWith("sessions.json.bak."));
|
|
||||||
expect(bakFiles).toHaveLength(1);
|
|
||||||
const timestamp = Number(bakFiles[0].replace("sessions.json.bak.", ""));
|
|
||||||
expect(timestamp).toBeGreaterThanOrEqual(before);
|
|
||||||
expect(timestamp).toBeLessThanOrEqual(after);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user