test: replace truthy test assertions · openclaw/openclaw@ac3b3a0
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
File tree
src/gateway/server-methods
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1766,7 +1766,7 @@ describe("createTelegramBot", () => {
|
1766 | 1766 | mediaRef: "telegram:file/root-photo-1", |
1767 | 1767 | }), |
1768 | 1768 | ]); |
1769 | | -expect(payload.ReplyChain?.[1]?.mediaPath).toBeTruthy(); |
| 1769 | +expect(payload.ReplyChain?.[1]?.mediaPath).toEqual(expect.any(String)); |
1770 | 1770 | expect(getFileSpy).toHaveBeenCalledWith("root-photo-1"); |
1771 | 1771 | expect(mediaFetch).toHaveBeenCalledTimes(1); |
1772 | 1772 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1483,7 +1483,7 @@ describe("exec approval handlers", () => {
|
1483 | 1483 | }, |
1484 | 1484 | }); |
1485 | 1485 | const requested = broadcasts.find((entry) => entry.event === "exec.approval.requested"); |
1486 | | -expect(requested).toBeTruthy(); |
| 1486 | +expect(requested).toEqual(expect.objectContaining({ event: "exec.approval.requested" })); |
1487 | 1487 | const request = (requested?.payload as { request?: Record<string, unknown> })?.request ?? {}; |
1488 | 1488 | expect(request["commandAnalysis"]).toEqual( |
1489 | 1489 | expect.objectContaining({ commandCount: 1, nestedCommandCount: 0 }), |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。