2015-09-26 19:06:28 +02:00
|
|
|
Running the tests:
|
|
|
|
|
|
|
|
```bash
|
2017-01-02 14:37:39 +03:00
|
|
|
# Token to be used
|
2015-09-26 19:06:28 +02:00
|
|
|
export TEST_TELEGRAM_TOKEN=<YOUR_BOT_TOKEN>
|
2017-01-02 14:37:39 +03:00
|
|
|
|
2015-09-26 19:06:28 +02:00
|
|
|
# User Id which you want to send the messages.
|
|
|
|
export TEST_USER_ID=<USER_ID>
|
2017-01-02 14:37:39 +03:00
|
|
|
|
2016-10-10 14:21:25 +03:00
|
|
|
# Group Id which to use in some of the tests, e.g. for TelegramBot#getChat()
|
|
|
|
export TEST_GROUP_ID=<GROUP_ID>
|
2017-01-02 14:37:39 +03:00
|
|
|
|
2017-10-07 14:50:25 +03:00
|
|
|
# Game short name to use in some tests, e.g. TelegramBot#sendGame()
|
|
|
|
# Defaults to "medusalab_test".
|
2017-01-02 14:37:39 +03:00
|
|
|
export TEST_GAME_SHORT_NAME=<GAME_SHORT_NAME>
|
|
|
|
|
2017-10-07 14:50:25 +03:00
|
|
|
# Sticker set name to use in some tests, e.g. TelegramBot#getStickerSet()
|
|
|
|
# Defaults to "pusheen".
|
|
|
|
export TEST_STICKER_SET_NAME=<STICKER_SET_NAME>
|
|
|
|
|
2017-05-26 17:59:22 +03:00
|
|
|
# Payment provider token to be used
|
|
|
|
export TEST_PROVIDER_TOKEN=<YOUR_PROVIDER_TOKEN>
|
|
|
|
|
2017-01-11 18:18:24 +03:00
|
|
|
# Run ALL tests
|
2015-09-26 19:06:28 +02:00
|
|
|
npm run test
|
2017-01-11 18:18:24 +03:00
|
|
|
|
|
|
|
# Run individual tests
|
|
|
|
npm run eslint # static-analysis
|
|
|
|
npm run mocha # mocha tests
|
2015-09-26 19:06:28 +02:00
|
|
|
```
|
2017-07-05 09:04:39 +03:00
|
|
|
Note: The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
|