slack-mock icon indicating copy to clipboard operation
slack-mock copied to clipboard

Slack-Mock integration test example with real Slack Bot

Open ndileep opened this issue 7 years ago • 1 comments

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!

ndileep avatar Jul 05 '17 16:07 ndileep

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.

garrett-griffin avatar Nov 21 '19 00:11 garrett-griffin