test: clear clickclack broad matchers · openclaw/openclaw@0614a3f
shakkernerd
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -115,22 +115,17 @@ describe("handleClickClackInbound", () => {
|
115 | 115 | |
116 | 116 | expect(runtime.channel.turn.runPrepared).not.toHaveBeenCalled(); |
117 | 117 | expect(runtime.agent.runEmbeddedPiAgent).not.toHaveBeenCalled(); |
118 | | -expect(runtime.llm.complete).toHaveBeenCalledWith( |
119 | | -expect.objectContaining({ |
120 | | -agentId: "service-bot", |
121 | | -model: "openai/gpt-5.4-mini", |
122 | | -maxTokens: 96, |
123 | | -purpose: "clickclack bot reply", |
124 | | -messages: [{ role: "user", content: "hello bot" }], |
125 | | -}), |
126 | | -); |
127 | | -expect(sendClickClackTextMock).toHaveBeenCalledWith( |
128 | | -expect.objectContaining({ |
129 | | -accountId: "service", |
130 | | -to: "channel:chn_1", |
131 | | -text: "service bot online", |
132 | | -replyToId: "msg_1", |
133 | | -}), |
134 | | -); |
| 118 | +const completionRequest = runtime.llm.complete.mock.calls[0]?.[0]; |
| 119 | +expect(completionRequest?.agentId).toBe("service-bot"); |
| 120 | +expect(completionRequest?.model).toBe("openai/gpt-5.4-mini"); |
| 121 | +expect(completionRequest?.maxTokens).toBe(96); |
| 122 | +expect(completionRequest?.purpose).toBe("clickclack bot reply"); |
| 123 | +expect(completionRequest?.messages).toEqual([{ role: "user", content: "hello bot" }]); |
| 124 | + |
| 125 | +const sendRequest = sendClickClackTextMock.mock.calls[0]?.[0]; |
| 126 | +expect(sendRequest?.accountId).toBe("service"); |
| 127 | +expect(sendRequest?.to).toBe("channel:chn_1"); |
| 128 | +expect(sendRequest?.text).toBe("service bot online"); |
| 129 | +expect(sendRequest?.replyToId).toBe("msg_1"); |
135 | 130 | }); |
136 | 131 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。