Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should work', () => {
const bot = new SlackBot({
accessToken: 'zzzzzZZZZZ',
});
const start = jest.fn();
const on = jest.fn();
const handler = jest.fn();
RTMClient.mockImplementation(() => ({
on,
start,
}));
bot.createRequestHandler = jest.fn(() => handler);
bot.createRtmRuntime();
expect(on).toBeCalledWith('message', handler);
expect(start).toHaveBeenCalledTimes(1);
});
});