Socket
Socket
Sign inDemoInstall

slack-rtm-test

Package Overview
Dependencies
68
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    slack-rtm-test

Utility that provides a mock server to make testing slack bots easier.


Version published
Maintainers
1
Install size
3.97 MB
Created

Readme

Source

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);
  })
})

Keywords

FAQs

Last updated on 14 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc