1.0.5 • Published 9 years ago

slack-rtm-test v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

slack-rtm-test

Provides utilities for testing slack bots.

Usage:

var slackTest = require('slack-rtm-test');

describe('it', function() {
  before(function() {
    slackTest.serve(8000, {
      channels: [
        { name: 'random', id: 'abc123'},
        { name: 'general', id: 'def456' }
      ]
    });
    var slackBaseUrl = 'http://localhost:8000'; // pass this to your slack client
  })

  it('works', function(done) {
    var conversation = [
      { text: 'ping', channel: 'abc123' }, // sends exactly this message over the slack websocket

      { response: /pong/ }, // expects this message within 100ms

      { text: 'ping longer', channel: '#general' },

      { response: /pong/, timeout: 2000 }, // expects this message within 2000ms
    ]

    slackTest.expectConversation(conversation, done);
  })
})
1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago