test: avoid core utility filter allocation assertions · openclaw/openclaw@3653127
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2024,8 +2024,8 @@ describe("doctor config flow", () => {
|
2024 | 2024 | .filter((call) => call[1] === "Doctor warnings" || call[1] === "Doctor changes") |
2025 | 2025 | .map((call) => call[0]); |
2026 | 2026 | const joinedOutputs = outputs.join("\n"); |
2027 | | -expect(outputs.filter((line) => line.includes("\u001b"))).toEqual([]); |
2028 | | -expect(outputs.filter((line) => line.includes("\nforged"))).toEqual([]); |
| 2027 | +expect(outputs.some((line) => line.includes("\u001b"))).toBe(false); |
| 2028 | +expect(outputs.some((line) => line.includes("\nforged"))).toBe(false); |
2029 | 2029 | expect(joinedOutputs).toContain('channels.slack.accounts.opsopen.allowFrom: set to ["*"]'); |
2030 | 2030 | expect(joinedOutputs).toContain('required by dmPolicy="open"'); |
2031 | 2031 | expect( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -158,7 +158,7 @@ describe("session-compaction-checkpoints", () => {
|
158 | 158 | expect(snapshot).toBeNull(); |
159 | 159 | expect(copyFileSyncSpy).not.toHaveBeenCalled(); |
160 | 160 | expect(MAX_COMPACTION_CHECKPOINT_SNAPSHOT_BYTES).toBeGreaterThan(64); |
161 | | -expect(fsSync.readdirSync(dir).filter((file) => file.includes(".checkpoint."))).toEqual([]); |
| 161 | +expect(fsSync.readdirSync(dir).some((file) => file.includes(".checkpoint."))).toBe(false); |
162 | 162 | } finally { |
163 | 163 | copyFileSyncSpy.mockRestore(); |
164 | 164 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,7 +41,7 @@ async function expectMissingScopeWithoutFallback(mockFetch: ScopeFallbackFetch)
|
41 | 41 | expectMissingScopeError(result); |
42 | 42 | const calledUrls = mockFetch.mock.calls.map(([input]) => toRequestUrl(input)); |
43 | 43 | expect(calledUrls.length).toBeGreaterThan(0); |
44 | | -expect(calledUrls.filter((url) => !url.includes("/api/oauth/usage"))).toEqual([]); |
| 44 | +expect(calledUrls.every((url) => url.includes("/api/oauth/usage"))).toBe(true); |
45 | 45 | } |
46 | 46 | |
47 | 47 | function makeOrgAResponse() { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -156,7 +156,7 @@ describe("wave-15 jsonc byte-fidelity", () => {
|
156 | 156 | const root = assertParseable(raw); |
157 | 157 | if (root.kind === "array") { |
158 | 158 | expect(root.items).toHaveLength(7); |
159 | | -expect(root.items.filter((item) => item.kind !== "number")).toEqual([]); |
| 159 | +expect(root.items.every((item) => item.kind === "number")).toBe(true); |
160 | 160 | } |
161 | 161 | }); |
162 | 162 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。