For an example please see the tests in this repo: https://github.com/botmasterai/botmaster-fulfill/blob/master/src/tests/fulfill-e2e.js
have bot master response done with a text. Chain it by calling it response(botmaster)(text)
Parameters
generate a new telegram incoming message for use with botmaster
Parameters
text
string?= 'hi' optional - the users text
Returns Object a mock telegram incoming message to use with telegramMock.sendMessage
generate an incoming update
Parameters
text
String? the bots text
Returns Object mock botmaster update after update handler
generate an outgoing message
Parameters
text
String? the bots text
Returns Object message to send with bot.sendMessage
A chainable mock for telegram that can send and expect messages. Construct it by calling it with these params.
Parameters
botmaster
Object the botmaster object being tested. we use this to get the app for use with supertest.mock
Object? a nock scope
Returns Object mock object with methods
mock telegram sending botmaster an update
Parameters
Returns Object the telegraMock object for chaining
expect botmaster to send certain responses
Parameters
Returns Object the telegraMock object for chaining
sugar syntax for nock.cleanAll() to remove any existing mocks