Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ndileep opened this issue Jul 5, 2017 · 1 comment
Open

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

ndileep opened this issue Jul 5, 2017 · 1 comment

Comments

@ndileep
Copy link

ndileep commented Jul 5, 2017

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants