test(qqbot): fix channel api bounded body assertion · openclaw/openclaw@b16fd6b
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
File tree
extensions/qqbot/src/engine/tools
| Original file line number | Diff line number | Diff line change |
|---|
@@ -101,8 +101,10 @@ describe("executeChannelApi", () => {
|
101 | 101 | status: 503, |
102 | 102 | path: "/guilds/123/channels", |
103 | 103 | }); |
104 | | -expect(JSON.stringify(result.details)).toContain("channel api unavailable"); |
105 | | -expect(JSON.stringify(result.details)).not.toContain("tail"); |
| 104 | +const bodyPreview = (result.details as { details?: unknown }).details; |
| 105 | +expect(typeof bodyPreview).toBe("string"); |
| 106 | +expect(bodyPreview).toContain("channel api unavailable"); |
| 107 | +expect(bodyPreview).not.toContain("tail"); |
106 | 108 | expect(tracked.wasCanceled()).toBe(true); |
107 | 109 | expect(textSpy).not.toHaveBeenCalled(); |
108 | 110 | expect(release).toHaveBeenCalledTimes(1); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。