test: verify infra outbound payloads · openclaw/openclaw@f2ab8ef
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -93,11 +93,10 @@ describe("runHeartbeatOnce responsePrefix templates", () => {
|
93 | 93 | }); |
94 | 94 | |
95 | 95 | expect(sendTelegram).toHaveBeenCalledTimes(1); |
96 | | -expect(sendTelegram).toHaveBeenCalledWith( |
97 | | -TELEGRAM_GROUP, |
98 | | -"[openai-codex/gpt-5.4|think:high] Heartbeat alert", |
99 | | -expect.any(Object), |
100 | | -); |
| 96 | +const [target, message, options] = sendTelegram.mock.calls[0] ?? []; |
| 97 | +expect(target).toBe(TELEGRAM_GROUP); |
| 98 | +expect(message).toBe("[openai-codex/gpt-5.4|think:high] Heartbeat alert"); |
| 99 | +expect(typeof options).toBe("object"); |
101 | 100 | }); |
102 | 101 | |
103 | 102 | it("uses the resolved responsePrefix when suppressing prefixed HEARTBEAT_OK replies", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -834,7 +834,7 @@ describe("runHeartbeatOnce", () => {
|
834 | 834 | replySpy, |
835 | 835 | 0, |
836 | 836 | { |
837 | | -Body: expect.stringMatching(/Ops check[\s\S]*Current time: /), |
| 837 | +Body: /Ops check[\s\S]*Current time: /, |
838 | 838 | SessionKey: sessionKey, |
839 | 839 | From: "120363401234567890@g.us", |
840 | 840 | To: "120363401234567890@g.us", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -156,11 +156,11 @@ describe("sendMessage channel normalization", () => {
|
156 | 156 | }, |
157 | 157 | }, |
158 | 158 | assertDeps: (deps: { localchat?: ReturnType<typeof vi.fn> }) => { |
159 | | -expect(deps.localchat).toHaveBeenCalledWith( |
160 | | - "someone@example.com", |
161 | | - "hi", |
162 | | - expect.any(Object), |
163 | | -); |
| 159 | +expect(deps.localchat).toHaveBeenCalledTimes(1); |
| 160 | +const [to, text, options] = deps.localchat?.mock.calls[0] ?? []; |
| 161 | +expect(to).toBe("someone@example.com"); |
| 162 | +expect(text).toBe("hi"); |
| 163 | +expect(typeof options).toBe("object"); |
164 | 164 | }, |
165 | 165 | expectedChannel: "localchat", |
166 | 166 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。