test: tighten telegram string assertions · openclaw/openclaw@49f1f71
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1766,7 +1766,8 @@ describe("createTelegramBot", () => {
|
1766 | 1766 | mediaRef: "telegram:file/root-photo-1", |
1767 | 1767 | }), |
1768 | 1768 | ]); |
1769 | | -expect(payload.ReplyChain?.[1]?.mediaPath).toEqual(expect.any(String)); |
| 1769 | +expect(payload.ReplyChain?.[1]?.mediaPath).toBeTypeOf("string"); |
| 1770 | +expect(payload.ReplyChain?.[1]?.mediaPath).not.toBe(""); |
1770 | 1771 | expect(getFileSpy).toHaveBeenCalledWith("root-photo-1"); |
1771 | 1772 | expect(mediaFetch).toHaveBeenCalledTimes(1); |
1772 | 1773 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -427,7 +427,8 @@ describe("deliverReplies", () => {
|
427 | 427 | }); |
428 | 428 | |
429 | 429 | expect(sendMessage).toHaveBeenCalledTimes(1); |
430 | | -expect(sendMessage.mock.calls[0]?.[1]).toEqual(expect.any(String)); |
| 430 | +expect(sendMessage.mock.calls[0]?.[1]).toBeTypeOf("string"); |
| 431 | +expect(sendMessage.mock.calls[0]?.[1]).not.toBe(""); |
431 | 432 | expect(sendMessage.mock.calls[0]?.[1]?.trim()).not.toBe("NO_REPLY"); |
432 | 433 | }); |
433 | 434 | |
@@ -445,7 +446,8 @@ describe("deliverReplies", () => {
|
445 | 446 | }); |
446 | 447 | |
447 | 448 | expect(sendMessage).toHaveBeenCalledTimes(1); |
448 | | -expect(sendMessage.mock.calls[0]?.[1]).toEqual(expect.any(String)); |
| 449 | +expect(sendMessage.mock.calls[0]?.[1]).toBeTypeOf("string"); |
| 450 | +expect(sendMessage.mock.calls[0]?.[1]).not.toBe(""); |
449 | 451 | expect(sendMessage.mock.calls[0]?.[1]?.trim()).not.toBe("NO_REPLY"); |
450 | 452 | }); |
451 | 453 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。