slack-mock
slack-mock copied to clipboard
Slack-Mock integration test example with real Slack Bot
Hi, wondering if there is an example of slack-mock being used with real Slack Bot. I am trying to use slack-mock with my Slack Bot. I modified examples/test/slack-app.spec.js to include my bot, as follows https://www.dropbox.com/sh/pf1n2ljfgptrw8q/AAC0MNpOOk3_vF3u7sllilv1a?dl=0
However, I get the following error message, when I run 'npm run examples' +++++++++ sent oauth ++++++++++ +++++++++ No error in oauth ++++++++++ +++++++++ sending rtm ++++++++++ Error: client with token xoxb-XXXXXXXXXXXX-TTTTTTTTTTTTTT has never connected to the RTM API
Thanks!
For what it's worth, your issue appears to be here:
before(function () {
// wait for bot to get bootstrapped
this.timeout(30000)
slackMock = require('../../index').instance
slackMock.reset()
require('../../../webexbot');
})
You need to use a delay or timeout after you setup your bot -- not before.