test: simplify dispatch block text collection · openclaw/openclaw@93ba934
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2562,9 +2562,13 @@ describe("dispatchReplyFromConfig", () => {
|
2562 | 2562 | |
2563 | 2563 | await dispatchReplyFromConfig({ ctx, cfg, dispatcher }); |
2564 | 2564 | |
2565 | | -const blockTexts = (dispatcher.sendBlockReply as ReturnType<typeof vi.fn>).mock.calls |
2566 | | -.map((call) => ((call[0] as ReplyPayload).text ?? "").trim()) |
2567 | | -.filter(Boolean); |
| 2565 | +const blockTexts: string[] = []; |
| 2566 | +for (const call of (dispatcher.sendBlockReply as ReturnType<typeof vi.fn>).mock.calls) { |
| 2567 | +const text = ((call[0] as ReplyPayload).text ?? "").trim(); |
| 2568 | +if (text.length > 0) { |
| 2569 | +blockTexts.push(text); |
| 2570 | +} |
| 2571 | +} |
2568 | 2572 | expect(blockTexts).toEqual(["What do you want to work on?"]); |
2569 | 2573 | expect(dispatcher.sendFinalReply).toHaveBeenCalledWith( |
2570 | 2574 | expect.objectContaining({ text: "What do you want to work on?" }), |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。