test: clarify telegram command assertions · openclaw/openclaw@7dc6a79
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,7 @@ function warningLines(): string[] {
|
23 | 23 | } |
24 | 24 | |
25 | 25 | function expectNoMissingDefaultWarning() { |
26 | | -expect(warningLines().every((line) => !line.includes("accounts.default is missing"))).toBe(true); |
| 26 | +expect(warningLines().filter((line) => line.includes("accounts.default is missing"))).toEqual([]); |
27 | 27 | } |
28 | 28 | |
29 | 29 | function resolveAccountWithEnv( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -69,8 +69,8 @@ describe("bot-native-command-menu", () => {
|
69 | 69 | 0, |
70 | 70 | ); |
71 | 71 | expect(totalText).toBeLessThanOrEqual(TELEGRAM_TOTAL_COMMAND_TEXT_BUDGET); |
72 | | -expect(result.commandsToRegister.every((command) => command.description.length <= 56)).toBe( |
73 | | -true, |
| 72 | +expect(result.commandsToRegister.filter((command) => command.description.length > 56)).toEqual( |
| 73 | +[], |
74 | 74 | ); |
75 | 75 | }); |
76 | 76 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -82,7 +82,7 @@ describe("registerTelegramNativeCommands skill allowlist integration", () => {
|
82 | 82 | |
83 | 83 | const registeredCommands = await waitForRegisteredCommands(setMyCommands); |
84 | 84 | |
85 | | -expect(registeredCommands.some((entry) => entry.command === "alpha_skill")).toBe(true); |
86 | | -expect(registeredCommands.some((entry) => entry.command === "beta_skill")).toBe(false); |
| 85 | +expect(registeredCommands.map((entry) => entry.command)).toContain("alpha_skill"); |
| 86 | +expect(registeredCommands.map((entry) => entry.command)).not.toContain("beta_skill"); |
87 | 87 | }); |
88 | 88 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -116,7 +116,7 @@ describe("markdownToTelegramHtml", () => {
|
116 | 116 | it("splits long multiline html text without breaking balanced tags", () => { |
117 | 117 | const chunks = splitTelegramHtmlChunks(`<b>${"A\n".repeat(2500)}</b>`, 4000); |
118 | 118 | expect(chunks.length).toBeGreaterThan(1); |
119 | | -expect(chunks.every((chunk) => chunk.length <= 4000)).toBe(true); |
| 119 | +expect(chunks.filter((chunk) => chunk.length > 4000)).toEqual([]); |
120 | 120 | expect(chunks[0]).toMatch(/^<b>[\s\S]*<\/b>$/); |
121 | 121 | expect(chunks[1]).toMatch(/^<b>[\s\S]*<\/b>$/); |
122 | 122 | }); |
@@ -128,7 +128,7 @@ describe("markdownToTelegramHtml", () => {
|
128 | 128 | it("treats malformed leading ampersands as plain text when chunking html", () => { |
129 | 129 | const chunks = splitTelegramHtmlChunks(`&${"A".repeat(5000)}`, 4000); |
130 | 130 | expect(chunks.length).toBeGreaterThan(1); |
131 | | -expect(chunks.every((chunk) => chunk.length <= 4000)).toBe(true); |
| 131 | +expect(chunks.filter((chunk) => chunk.length > 4000)).toEqual([]); |
132 | 132 | }); |
133 | 133 | |
134 | 134 | it("fails loudly when tag overhead leaves no room for text", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。