2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 09:57:10 +00:00
GochoMugo 64bbefd898
test: Fix tests for 'TelegramBot#onText()'
Bug:

  The registered listeners remain in effect even after
  the suite is completed; allowing other suites to trigger
  the listeners.

Fix:

  Perform clean-up before moving to next suite.
2017-05-13 11:34:14 +03:00
..
2017-01-02 14:37:39 +03:00
2017-01-20 09:13:18 +03:00
2017-02-09 16:12:22 +03:00

Running the tests:

# Token to be used
export TEST_TELEGRAM_TOKEN=<YOUR_BOT_TOKEN>

# User Id which you want to send the messages.
export TEST_USER_ID=<USER_ID>

# Group Id which to use in some of the tests, e.g. for TelegramBot#getChat()
export TEST_GROUP_ID=<GROUP_ID>

# Game short name which to use in some of the tests, e.g. TelegramBot#sendGame()
export TEST_GAME_SHORT_NAME=<GAME_SHORT_NAME>

# Run ALL tests
npm run test

# Run individual tests
npm run eslint              # static-analysis
npm run mocha               # mocha tests