


























@@ -27,6 +27,16 @@ import {
27272828const { createTempWorkspace } = createMemoryCoreTestHarness();
292930+function collectWikiResultPaths(results: readonly { corpus: string; path: string }[]): string[] {
31+const paths: string[] = [];
32+for (const result of results) {
33+if (result.corpus === "wiki") {
34+paths.push(result.path);
35+}
36+}
37+return paths;
38+}
39+3040async function waitFor<T>(task: () => Promise<T>, timeoutMs: number = 1500): Promise<T> {
3141const startedAt = Date.now();
3242let lastError: unknown;
@@ -369,9 +379,7 @@ describe("memory tools", () => {
369379expect(corpora).toContain("memory");
370380expect(corpora).toContain("wiki");
371381expect(details.results).toHaveLength(5);
372-expect(
373-details.results.filter((entry) => entry.corpus === "wiki").map((entry) => entry.path),
374-).toEqual(["w1.md", "w2.md", "w3.md", "w4.md"]);
382+expect(collectWikiResultPaths(details.results)).toEqual(["w1.md", "w2.md", "w3.md", "w4.md"]);
375383});
376384377385it("merges memory and wiki corpus search results for corpus=all", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。