test: clarify live loose boolean assertions · openclaw/openclaw@be28fdc
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -130,7 +130,8 @@ describeLive("xai live", () => {
|
130 | 130 | : []; |
131 | 131 | expect(payloadTools.length).toBeGreaterThan(0); |
132 | 132 | const firstFunction = payloadTools[0]?.function; |
133 | | -expect(firstFunction && typeof firstFunction === "object").toBe(true); |
| 133 | +expect(firstFunction).not.toBeNull(); |
| 134 | +expect(typeof firstFunction).toBe("object"); |
134 | 135 | expect([undefined, false]).toContain((firstFunction as Record<string, unknown>).strict); |
135 | 136 | }); |
136 | 137 | }, 90_000); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -238,7 +238,7 @@ const COMMAND_PROFILES: Record<string, CommandProfile> = {
|
238 | 238 | outcome: "success", |
239 | 239 | onSuccess: (payload) => { |
240 | 240 | const obj = assertObjectPayload("sms.search", payload); |
241 | | -expect(typeof obj.count === "number" || typeof obj.count === "string").toBe(true); |
| 241 | +expect(["number", "string"]).toContain(typeof obj.count); |
242 | 242 | expect(Array.isArray(obj.messages)).toBe(true); |
243 | 243 | }, |
244 | 244 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。