hubot-mock-adapter-as-promised
v1.2.2
Published
A helper for hubot-mock-adapter with promise
Downloads
9
Readme
hubot-mock-adapter-as-promised
A helper for hubot-mock-adapter with promise (bluebird).
Installation
Install with npm:
npm install -g coffee-script
npm install hubot-mock-adapter --save-dev
npm install hubot-mock-adapter-as-promised --save-dev
Example
./scripts/ping.coffee
module.exports = (robot) ->
robot.respond /PING$/i, (msg) ->
msg.send "PONG"
./test/ping_test.coffee
expect = require('chai').use(require('chai-as-promised')).expect
hubot = require('hubot-mock-adapter-as-promised')
describe 'ping', ->
hubot.includeContext ->
robot.loadFile(require('path').resolve('.', 'scripts'), 'ping.coffee')
it 'responds PONG', ->
expect(hubot.text('hubot ping'))
.to.eventually.equal('PONG')
See more examples in ./example/test.