test(plugin-sdk): type telegram command config mock

This commit is contained in:
Altay
2026-04-05 02:37:16 +03:00
parent 2ba3484d10
commit 04b64e40d4

View File

@@ -1,7 +1,21 @@
import { describe, expect, it, vi } from "vitest";
import { TELEGRAM_COMMAND_NAME_PATTERN as bundledTelegramCommandNamePattern } from "../../extensions/telegram/src/command-config.ts";
const getBundledChannelContractSurfaceModule = vi.fn(() => null);
type BundledChannelContractSurfaceParams = Parameters<
(typeof import("../channels/plugins/contract-surfaces.js"))["getBundledChannelContractSurfaceModule"]
>[0];
type TelegramCommandConfigContract = Pick<
typeof import("./telegram-command-config.js"),
| "TELEGRAM_COMMAND_NAME_PATTERN"
| "normalizeTelegramCommandName"
| "normalizeTelegramCommandDescription"
| "resolveTelegramCustomCommands"
>;
const getBundledChannelContractSurfaceModule = vi.fn<
(params: BundledChannelContractSurfaceParams) => TelegramCommandConfigContract | null
>(() => null);
vi.mock("../channels/plugins/contract-surfaces.js", () => ({
getBundledChannelContractSurfaceModule,