test: clarify memory core assertions · openclaw/openclaw@774e8a7
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
File tree
extensions/memory-core/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -979,7 +979,7 @@ describe("generateAndAppendDreamNarrative", () => {
|
979 | 979 | expect(updatedStore).toHaveProperty("agent:main:kept-session"); |
980 | 980 | expect(updatedStore).toHaveProperty("agent:main:telegram:group:dreaming-narrative-room"); |
981 | 981 | const sessionFiles = await fs.readdir(sessionsDir); |
982 | | -expect(sessionFiles.some((name) => name.startsWith("orphan.jsonl.deleted."))).toBe(true); |
| 982 | +expect(sessionFiles).toContainEqual(expect.stringMatching(/^orphan\.jsonl\.deleted\./)); |
983 | 983 | expect(sessionFiles).toContain("still-live.jsonl"); |
984 | 984 | expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("dreaming cleanup scrubbed")); |
985 | 985 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -122,7 +122,7 @@ describe("dreaming artifact repair", () => {
|
122 | 122 | ).rejects.toMatchObject({ code: "ENOENT" }); |
123 | 123 | await expect(fs.readFile(dreamsPath, "utf-8")).resolves.toContain("# Dream Diary"); |
124 | 124 | const archivedEntries = await fs.readdir(repair.archiveDir!); |
125 | | -expect(archivedEntries.some((entry) => entry.startsWith("session-corpus."))).toBe(true); |
126 | | -expect(archivedEntries.some((entry) => entry.startsWith("session-ingestion.json."))).toBe(true); |
| 125 | +expect(archivedEntries).toContainEqual(expect.stringMatching(/^session-corpus\./)); |
| 126 | +expect(archivedEntries).toContainEqual(expect.stringMatching(/^session-ingestion\.json\./)); |
127 | 127 | }); |
128 | 128 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,7 @@ describe("memory embedding policy", () => {
|
23 | 23 | const batches = buildMemoryEmbeddingBatches([chunk(line), chunk(line)], 8000); |
24 | 24 | |
25 | 25 | expect(batches).toHaveLength(2); |
26 | | -expect(batches.every((batch) => batch.length === 1)).toBe(true); |
| 26 | +expect(batches.map((batch) => batch.length)).toEqual([1, 1]); |
27 | 27 | }); |
28 | 28 | |
29 | 29 | it("keeps small files in a single embedding batch", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。