mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-31 06:16:07 +00:00
src/telegram: Deprecate auto-enabling Promise cancellation
Side-effects: src/telegram: Allow providing custom Promise constructor References: * BR: https://github.com/yagop/node-telegram-bot-api/issues/319
This commit is contained in:
@@ -109,6 +109,15 @@ describe('TelegramBot', function telegramSuite() {
|
||||
});
|
||||
});
|
||||
|
||||
it('allows providing custom Promise library', function test() {
|
||||
TelegramBot.Promise = global.Promise;
|
||||
const promise = bot.stopPolling();
|
||||
assert.ok(promise instanceof global.Promise);
|
||||
assert.ok(!(promise instanceof Promise));
|
||||
// revert
|
||||
TelegramBot.Promise = Promise;
|
||||
});
|
||||
|
||||
it('automatically starts polling', function test() {
|
||||
assert.equal(botPolling.isPolling(), true);
|
||||
return utils.isPollingMockServer(pollingPort2);
|
||||
|
Reference in New Issue
Block a user