test(telegram): type reaction body mock · openclaw/openclaw@88f22b3
vincentkoc
·
2026-05-07
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
2 | 2 | import type { BuildTelegramMessageContextParams } from "./bot-message-context.types.js"; |
3 | 3 | |
| 4 | +type InboundBodyMock = (arg: unknown) => Promise<{ |
| 5 | +bodyText: string; |
| 6 | +rawBody: string; |
| 7 | +historyKey: undefined; |
| 8 | +commandAuthorized: boolean; |
| 9 | +effectiveWasMentioned: boolean; |
| 10 | +canDetectMention: boolean; |
| 11 | +shouldBypassMention: boolean; |
| 12 | +stickerCacheHit: boolean; |
| 13 | +locationData: undefined; |
| 14 | +}>; |
| 15 | + |
4 | 16 | const inboundBodyMock = vi.hoisted(() => |
5 | | -vi.fn(async () => ({ |
| 17 | +vi.fn<InboundBodyMock>(async () => ({ |
6 | 18 | bodyText: "hello", |
7 | 19 | rawBody: "hello", |
8 | 20 | historyKey: undefined, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。