mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 04:20:43 +00:00
test: clarify memory core assertions
This commit is contained in:
@@ -979,7 +979,7 @@ describe("generateAndAppendDreamNarrative", () => {
|
||||
expect(updatedStore).toHaveProperty("agent:main:kept-session");
|
||||
expect(updatedStore).toHaveProperty("agent:main:telegram:group:dreaming-narrative-room");
|
||||
const sessionFiles = await fs.readdir(sessionsDir);
|
||||
expect(sessionFiles.some((name) => name.startsWith("orphan.jsonl.deleted."))).toBe(true);
|
||||
expect(sessionFiles).toContainEqual(expect.stringMatching(/^orphan\.jsonl\.deleted\./));
|
||||
expect(sessionFiles).toContain("still-live.jsonl");
|
||||
expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("dreaming cleanup scrubbed"));
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ describe("dreaming artifact repair", () => {
|
||||
).rejects.toMatchObject({ code: "ENOENT" });
|
||||
await expect(fs.readFile(dreamsPath, "utf-8")).resolves.toContain("# Dream Diary");
|
||||
const archivedEntries = await fs.readdir(repair.archiveDir!);
|
||||
expect(archivedEntries.some((entry) => entry.startsWith("session-corpus."))).toBe(true);
|
||||
expect(archivedEntries.some((entry) => entry.startsWith("session-ingestion.json."))).toBe(true);
|
||||
expect(archivedEntries).toContainEqual(expect.stringMatching(/^session-corpus\./));
|
||||
expect(archivedEntries).toContainEqual(expect.stringMatching(/^session-ingestion\.json\./));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ describe("memory embedding policy", () => {
|
||||
const batches = buildMemoryEmbeddingBatches([chunk(line), chunk(line)], 8000);
|
||||
|
||||
expect(batches).toHaveLength(2);
|
||||
expect(batches.every((batch) => batch.length === 1)).toBe(true);
|
||||
expect(batches.map((batch) => batch.length)).toEqual([1, 1]);
|
||||
});
|
||||
|
||||
it("keeps small files in a single embedding batch", () => {
|
||||
|
||||
Reference in New Issue
Block a user