HomePhabricator

[alias-server] Initialize telegram bot in index.js and pass as function…

Description

[alias-server] Initialize telegram bot in index.js and pass as function parameter to websocket functions

Summary:
T3060

Initializing the telegram bot creates a polling telegram bot. If this is done in any unit tests, the unit test will hang indefinitely and not resolve.

Initialize the telegram bot from index.js on app startup and pass as a param. In this way, you can mock it for unit tests, or create unit tests that do not depend on the telegram bot.

Test Plan:
Confirm no lint errors related to parameter redefinition
node index.js and nothing breaks

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13560

Details

Provenance
bytesofmanAuthored on Apr 4 2023, 10:36
bytesofmanPushed on Apr 4 2023, 15:19
Reviewer
Restricted Project
Differential Revision
D13560: [alias-server] Initialize telegram bot in index.js and pass as function parameter to websocket functions
Parents
rABCe24424ba7ea8: [herald] add to arc lint
Branches
Unknown
Tags
Unknown