This repository's purpose is to demonstrate how Telegram bots, developed with the help of grammY framework could be tested.
It's assumed, that you configure complete bot logic in the bot.js file end then export it. So your bot can be imported in the __tests__/bot.test.js and tested.
During the tests we do not want our bot to interact with Telegram servers in any way. We can use transformer function which catches the outgoing requests. In our example, we record these outgoing requests, so later we can assert them.
npm i
# run tests
npm test
# run bot
BOT_TOKEN=%YOUR_TOKEN% node start.js