Skellington-Closet / slack-mock

A Slack API mocker for Slack bot integration tests.
MIT License
64 stars 15 forks source link

Slack-Mock integration test example with real Slack Bot #19

Open ndileep opened 7 years ago

ndileep commented 7 years ago

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!

garrett-griffin commented 4 years ago

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.