Telegram test
Simple module for testing telegram bots, created with node-telegram-bot-api
which lets you test bot's logic without using telegram API.
Installation
npm install telegram-test
Usage
Include all necessary modules
var TelegramTester = TelegramBot = telegramBot = "sample token" {};
Create a bot with any kind of logic
{ bot; bot; bot; bot; }
Write tests
(note that telegramBot is an instance of node-telegram-bot-api):
;
You can also emulate selecting different actions, using data.keyboard like this:
;
Of cause you can also make a simple array of choices and iterate through it.