mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 02:42:54 +00:00
19 lines
523 B
TypeScript
19 lines
523 B
TypeScript
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
import { buildMemoryFlushPlan } from "./flush-plan.js";
|
|
|
|
describe("buildMemoryFlushPlan", () => {
|
|
afterEach(() => {
|
|
vi.restoreAllMocks();
|
|
});
|
|
|
|
it("falls back when the injected timestamp is outside Date range", () => {
|
|
vi.spyOn(Date, "now").mockReturnValue(Date.UTC(2026, 4, 30, 12, 0, 0));
|
|
|
|
const plan = buildMemoryFlushPlan({
|
|
nowMs: 8_640_000_000_000_001,
|
|
});
|
|
|
|
expect(plan?.relativePath).toBe("memory/2026-05-30.md");
|
|
});
|
|
});
|