test: avoid extension filter allocation assertions · openclaw/openclaw@c33d71c
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,7 +50,7 @@ describe("discord wildcard component registration ids", () => {
|
50 | 50 | const components = createWildcardComponents(); |
51 | 51 | const customIds = components.map((component) => component.customId); |
52 | 52 | |
53 | | -expect(customIds.filter((id) => id === "*")).toEqual([]); |
| 53 | +expect(customIds.some((id) => id === "*")).toBe(false); |
54 | 54 | expect(new Set(customIds).size).toBe(customIds.length); |
55 | 55 | }); |
56 | 56 | |
|
| 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.filter((cluster) => !cluster.entries)).toEqual([]); |
| 62 | +expect(clusters.every((cluster) => cluster.entries)).toBe(true); |
63 | 63 | }); |
64 | 64 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -47,7 +47,7 @@ describe("lintMemoryWikiVault", () => {
|
47 | 47 | |
48 | 48 | const result = await lintMemoryWikiVault(config); |
49 | 49 | |
50 | | -expect(result.issues.filter((issue) => issue.code === "broken-wikilink")).toEqual([]); |
| 50 | +expect(result.issues.some((issue) => issue.code === "broken-wikilink")).toBe(false); |
51 | 51 | }); |
52 | 52 | |
53 | 53 | it("detects duplicate ids, provenance gaps, contradictions, and open questions", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -359,7 +359,7 @@ describe("microsoft-foundry plugin", () => {
|
359 | 359 | prepareRuntimeAuth(runtimeContext), |
360 | 360 | prepareRuntimeAuth(runtimeContext), |
361 | 361 | ]); |
362 | | -expect(failed.filter((result) => result.status !== "rejected")).toEqual([]); |
| 362 | +expect(failed.every((result) => result.status === "rejected")).toBe(true); |
363 | 363 | expect(execFileMock).toHaveBeenCalledTimes(1); |
364 | 364 | |
365 | 365 | const [first, second] = await Promise.all([ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -429,7 +429,7 @@ describe("ollama setup", () => {
|
429 | 429 | "gpt-oss:120b-cloud", |
430 | 430 | ]); |
431 | 431 | const requestUrls = fetchMock.mock.calls.map((call) => requestUrl(call[0])); |
432 | | -expect(requestUrls.filter((url) => url.endsWith("/api/show"))).toEqual([]); |
| 432 | +expect(requestUrls.some((url) => url.endsWith("/api/show"))).toBe(false); |
433 | 433 | expect(requestUrls).toContain("https://ollama.com/api/tags"); |
434 | 434 | }); |
435 | 435 | |
@@ -697,7 +697,7 @@ describe("ollama setup", () => {
|
697 | 697 | |
698 | 698 | expect(fetchMock).toHaveBeenCalledTimes(2); |
699 | 699 | const requestUrls = fetchMock.mock.calls.map((call) => requestUrl(call[0])); |
700 | | -expect(requestUrls.filter((url) => url.endsWith("/api/pull"))).toEqual([]); |
| 700 | +expect(requestUrls.some((url) => url.endsWith("/api/pull"))).toBe(false); |
701 | 701 | expect(result.models?.providers?.ollama?.models?.map((model) => model.id)).toEqual([ |
702 | 702 | "gemma4:latest", |
703 | 703 | ]); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -290,7 +290,7 @@ describe("handleSlackAction", () => {
|
290 | 290 | text: expect.stringContaining("/tmp/openclaw-media/report.pdf"), |
291 | 291 | }), |
292 | 292 | ); |
293 | | -expect(result.content.filter((entry) => entry.type === "image")).toEqual([]); |
| 293 | +expect(result.content.some((entry) => entry.type === "image")).toBe(false); |
294 | 294 | expect(result.details).toEqual( |
295 | 295 | expect.objectContaining({ |
296 | 296 | ok: true, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -93,7 +93,7 @@ describe("Slack directory contract", () => {
|
93 | 93 | limit: 2, |
94 | 94 | }); |
95 | 95 | expect(peers).toHaveLength(2); |
96 | | -expect(peers.filter((entry) => !entry.id.startsWith("user:u"))).toEqual([]); |
| 96 | +expect(peers.every((entry) => entry.id.startsWith("user:u"))).toBe(true); |
97 | 97 | }); |
98 | 98 | |
99 | 99 | it("resolves current Slack account identity from live auth", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。