test: repair extension test type drift · openclaw/openclaw@0c21699
steipete
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -109,6 +109,10 @@ describe("toWikiPageSummary", () => {
|
109 | 109 | relativePath: "entities/brad.md", |
110 | 110 | raw, |
111 | 111 | }); |
| 112 | +expect(summary).not.toBeNull(); |
| 113 | +if (!summary) { |
| 114 | +throw new Error("expected wiki summary"); |
| 115 | +} |
112 | 116 | |
113 | 117 | expect(summary.entityType).toBe("person"); |
114 | 118 | expect(summary.canonicalId).toBe("maintainer.brad-groux"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -640,7 +640,7 @@ describe("searchMemoryWiki", () => {
|
640 | 640 | }); |
641 | 641 | |
642 | 642 | expect(results).toHaveLength(2); |
643 | | -expect(results.map((result) => result.corpus).sort()).toEqual(["memory", "wiki"]); |
| 643 | +expect(results.map((result) => result.corpus).toSorted()).toEqual(["memory", "wiki"]); |
644 | 644 | expect(manager.search).toHaveBeenCalledWith("alpha", { maxResults: 5 }); |
645 | 645 | expect(getActiveMemorySearchManagerMock).toHaveBeenCalledWith({ |
646 | 646 | cfg: createAppConfig(), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,7 @@ describe("memory-wiki tools", () => {
|
23 | 23 | const evidenceArraySchema = asSchemaObject(evidenceSchema.items); |
24 | 24 | const evidenceProperties = asSchemaObject(evidenceArraySchema.properties); |
25 | 25 | |
26 | | -expect(Object.keys(evidenceProperties).sort()).toEqual([ |
| 26 | +expect(Object.keys(evidenceProperties).toSorted()).toEqual([ |
27 | 27 | "confidence", |
28 | 28 | "kind", |
29 | 29 | "lines", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -136,9 +136,10 @@ describe("ollama setup", () => {
|
136 | 136 | |
137 | 137 | it("Docker setup defaults to the host Ollama endpoint", async () => { |
138 | 138 | vi.stubEnv("OPENCLAW_DOCKER_SETUP", "1"); |
| 139 | +const text = vi.fn().mockResolvedValueOnce("http://host.docker.internal:11434"); |
139 | 140 | const prompter = { |
140 | 141 | select: vi.fn().mockResolvedValueOnce("local-only"), |
141 | | -text: vi.fn().mockResolvedValueOnce("http://host.docker.internal:11434"), |
| 142 | + text, |
142 | 143 | note: vi.fn(async () => undefined), |
143 | 144 | } as unknown as WizardPrompter; |
144 | 145 | |
@@ -150,7 +151,7 @@ describe("ollama setup", () => {
|
150 | 151 | prompter, |
151 | 152 | }); |
152 | 153 | |
153 | | -const baseUrlPrompt = prompter.text.mock.calls[0]?.[0] as { |
| 154 | +const baseUrlPrompt = text.mock.calls[0]?.[0] as { |
154 | 155 | message?: string; |
155 | 156 | initialValue?: string; |
156 | 157 | placeholder?: string; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。