mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:21:38 +00:00
test: remove redundant stale-prune return-count case
This commit is contained in:
@@ -101,21 +101,6 @@ describe("pruneStaleEntries", () => {
|
|||||||
expect(Object.keys(store)).toHaveLength(0);
|
expect(Object.keys(store)).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns count of pruned entries", () => {
|
|
||||||
const now = Date.now();
|
|
||||||
const store = makeStore([
|
|
||||||
["stale1", makeEntry(now - 15 * DAY_MS)],
|
|
||||||
["stale2", makeEntry(now - 30 * DAY_MS)],
|
|
||||||
["fresh1", makeEntry(now - 5 * DAY_MS)],
|
|
||||||
["fresh2", makeEntry(now)],
|
|
||||||
]);
|
|
||||||
|
|
||||||
const pruned = pruneStaleEntries(store, 10 * DAY_MS);
|
|
||||||
|
|
||||||
expect(pruned).toBe(2);
|
|
||||||
expect(Object.keys(store)).toHaveLength(2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("entry exactly at the boundary is kept", () => {
|
it("entry exactly at the boundary is kept", () => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const store = makeStore([["borderline", makeEntry(now - 30 * DAY_MS + 1000)]]);
|
const store = makeStore([["borderline", makeEntry(now - 30 * DAY_MS + 1000)]]);
|
||||||
|
|||||||
Reference in New Issue
Block a user