customer/src/modules/content/mock-channel.ts
Peppa 66eae294cf
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 1с
peppa/test test: success за 31с
peppa/build build: success за 1с
ci / checks (pull_request) Successful in 44s
deploy / deploy (pull_request) Successful in 3s
CLT-9: контент-агент — блог, автопостинг в Telegram, UTM и QR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 14:58:29 +05:00

16 lines
584 B
TypeScript

import type { ChannelClient } from "./telegram.ts";
/** Мок Telegram-канала: запоминает сообщения; `failing = true` — имитирует недоступность. */
export function mockChannel(): ChannelClient & { sent: { chatId: string; text: string }[]; failing: boolean } {
const sent: { chatId: string; text: string }[] = [];
const m = {
sent,
failing: false,
async sendMessage(chatId: string, text: string) {
if (m.failing) throw new Error("mock channel down");
sent.push({ chatId, text });
},
};
return m;
}