test: clarify memory wiki assertions · openclaw/openclaw@feccd70
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3628,13 +3628,11 @@ describe("active-memory plugin", () => {
|
3628 | 3628 | ), |
3629 | 3629 | ); |
3630 | 3630 | expect( |
3631 | | -vi |
3632 | | -.mocked(api.logger.info) |
3633 | | -.mock.calls.some((call: unknown[]) => |
3634 | | -String(call[0]).includes(`transcript=${expectedDir}${path.sep}`), |
3635 | | -), |
3636 | | -).toBe(true); |
3637 | | -expect(rmSpy.mock.calls.some(([target]) => String(target).startsWith(expectedDir))).toBe(false); |
| 3631 | +vi.mocked(api.logger.info).mock.calls.map((call: unknown[]) => String(call[0])), |
| 3632 | +).toContainEqual(expect.stringContaining(`transcript=${expectedDir}${path.sep}`)); |
| 3633 | +expect(rmSpy.mock.calls.filter(([target]) => String(target).startsWith(expectedDir))).toEqual( |
| 3634 | +[], |
| 3635 | +); |
3638 | 3636 | }); |
3639 | 3637 | |
3640 | 3638 | it("falls back to the default transcript directory when transcriptDir is unsafe", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -59,6 +59,6 @@ describe("buildPageContradictionClusters", () => {
|
59 | 59 | |
60 | 60 | expect(clusters).toHaveLength(2); |
61 | 61 | expect(clusters.map((cluster) => cluster.key).toSorted()).toEqual(["किताब", "कीताब"]); |
62 | | -expect(clusters.every((cluster) => cluster.entries)).toBe(true); |
| 62 | +expect(clusters.filter((cluster) => !cluster.entries)).toEqual([]); |
63 | 63 | }); |
64 | 64 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -638,8 +638,9 @@ describe("searchMemoryWiki", () => {
|
638 | 638 | }); |
639 | 639 | |
640 | 640 | expect(results).toHaveLength(2); |
641 | | -expect(results.some((result) => result.corpus === "wiki")).toBe(true); |
642 | | -expect(results.some((result) => result.corpus === "memory")).toBe(true); |
| 641 | +expect(results.map((result) => result.corpus)).toEqual( |
| 642 | +expect.arrayContaining(["wiki", "memory"]), |
| 643 | +); |
643 | 644 | expect(manager.search).toHaveBeenCalledWith("alpha", { maxResults: 5 }); |
644 | 645 | expect(getActiveMemorySearchManagerMock).toHaveBeenCalledWith({ |
645 | 646 | cfg: createAppConfig(), |
@@ -691,7 +692,7 @@ describe("searchMemoryWiki", () => {
|
691 | 692 | }); |
692 | 693 | |
693 | 694 | expect(results).toHaveLength(5); |
694 | | -expect(results.some((result) => result.corpus === "memory")).toBe(true); |
| 695 | +expect(results.map((result) => result.corpus)).toContain("memory"); |
695 | 696 | expect( |
696 | 697 | results.filter((result) => result.corpus === "wiki").map((result) => result.path), |
697 | 698 | ).toEqual([ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。