test: fix telegram proxy send mock · openclaw/openclaw@0d93faa
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
2 | 2 | |
3 | 3 | const { botApi, botCtorSpy } = vi.hoisted(() => ({ |
4 | 4 | botApi: { |
| 5 | +config: { use: vi.fn() }, |
5 | 6 | sendMessage: vi.fn(), |
6 | 7 | setMessageReaction: vi.fn(), |
7 | 8 | deleteMessage: vi.fn(), |
@@ -110,6 +111,7 @@ describe("telegram proxy client", () => {
|
110 | 111 | botApi.sendMessage.mockResolvedValue({ message_id: 1, chat: { id: "123" } }); |
111 | 112 | botApi.setMessageReaction.mockResolvedValue(undefined); |
112 | 113 | botApi.deleteMessage.mockResolvedValue(true); |
| 114 | +botApi.config.use.mockClear(); |
113 | 115 | botCtorSpy.mockClear(); |
114 | 116 | loadConfig.mockReturnValue(TELEGRAM_PROXY_CFG); |
115 | 117 | makeProxyFetch.mockClear(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。