test: avoid command filter allocation assertions · openclaw/openclaw@aa8b233
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -105,8 +105,8 @@ describe("command secret target ids", () => {
|
105 | 105 | |
106 | 106 | expect(scoped.targetIds.size).toBeGreaterThan(0); |
107 | 107 | const targetIds = [...scoped.targetIds]; |
108 | | -expect(targetIds.filter((id) => !id.startsWith("channels.discord."))).toEqual([]); |
109 | | -expect(targetIds.filter((id) => id.startsWith("channels.telegram."))).toEqual([]); |
| 108 | +expect(targetIds.every((id) => id.startsWith("channels.discord."))).toBe(true); |
| 109 | +expect(targetIds.some((id) => id.startsWith("channels.telegram."))).toBe(false); |
110 | 110 | }); |
111 | 111 | |
112 | 112 | it("does not coerce missing accountId to default when channel is scoped", () => { |
@@ -128,7 +128,7 @@ describe("command secret target ids", () => {
|
128 | 128 | |
129 | 129 | expect(scoped.allowedPaths).toBeUndefined(); |
130 | 130 | expect(scoped.targetIds.size).toBeGreaterThan(0); |
131 | | -expect([...scoped.targetIds].filter((id) => !id.startsWith("channels.discord."))).toEqual([]); |
| 131 | +expect([...scoped.targetIds].every((id) => id.startsWith("channels.discord."))).toBe(true); |
132 | 132 | }); |
133 | 133 | |
134 | 134 | it("scopes allowed paths to channel globals + selected account", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -382,7 +382,7 @@ describe("agentCommand ACP runtime routing", () => {
|
382 | 382 | await withAcpSessionEnv(async () => { |
383 | 383 | const { assistantEvents, logLines } = await runAcpTurnWithAssistantEvents(["NO_REPLY"]); |
384 | 384 | |
385 | | -expect(assistantEvents.map((event) => event.text).filter(Boolean)).toEqual([]); |
| 385 | +expect(assistantEvents.every((event) => !event.text)).toBe(true); |
386 | 386 | expect(logLines).not.toEqual(expect.arrayContaining([expect.stringContaining("NO_REPLY")])); |
387 | 387 | expect(logLines).toEqual([]); |
388 | 388 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -268,7 +268,7 @@ describe("resolveGatewayInstallToken", () => {
|
268 | 268 | |
269 | 269 | expect(result.token).toBeUndefined(); |
270 | 270 | expect(result.unavailableReason).toBeUndefined(); |
271 | | -expect(result.warnings.filter((message) => message.includes("Auto-generated"))).toEqual([]); |
| 271 | +expect(result.warnings.some((message) => message.includes("Auto-generated"))).toBe(false); |
272 | 272 | expect(replaceConfigFileMock).not.toHaveBeenCalled(); |
273 | 273 | }); |
274 | 274 | |
@@ -300,7 +300,7 @@ describe("resolveGatewayInstallToken", () => {
|
300 | 300 | }); |
301 | 301 | expect(result.token).toBeUndefined(); |
302 | 302 | expect(result.unavailableReason).toBeUndefined(); |
303 | | -expect(result.warnings.filter((message) => message.includes("Auto-generated"))).toEqual([]); |
| 303 | +expect(result.warnings.some((message) => message.includes("Auto-generated"))).toBe(false); |
304 | 304 | expect(replaceConfigFileMock).not.toHaveBeenCalled(); |
305 | 305 | }); |
306 | 306 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。