Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hubot-test-helper-pull-request-1

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubot-test-helper-pull-request-1

Helper for testing hubot script

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Hubot test helper

Build Status

Install

npm install hubot-test-helper --save-dev

Usage

If you have a following hubot script:

module.exports = (robot) ->
  robot.respond /hi$/i, (msg) ->
    msg.reply 'hi'

You can test it like:

Helper = require('hubot-test-helper')
# helper loads all scripts passed a directory
helper = new Helper('./scripts')

# helper loads a specific script if it's a file
scriptHelper = new Helper('./scripts/specific-script.coffee')

expect = require('chai').expect

describe 'hello-world', ->
  room = null

  beforeEach ->
    room = helper.createRoom()

  context 'user says hi to hubot', ->
    beforeEach ->
      room.user.say 'alice', '@hubot hi'
      room.user.say 'bob',   '@hubot hi'

    it 'should reply to user', ->
      expect(room.messages).to.eql [
        ['alice', '@hubot hi']
        ['hubot', '@alice hi']
        ['bob',   '@hubot hi']
        ['hubot', '@bob hi']
      ]

Keywords

FAQs

Package last updated on 13 Jun 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc