1.1.0 • Published 8 years ago

mock-hubot v1.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Mock-hubot

This is a simple wrapper library around hubot-mock-adapter.

###How to use $ npm install --save-dev mock-hubot

Assume we were to test this script.

humock = require 'mock-hubot'
helloScript = require './hello-script.coffee'
{expect} = require 'chai'

describe 'test', ->

    beforeEach (done) ->
      humock.start ->
        humock.learn helloScript
        done()

    afterEach (done) ->
      humock.shutdown -> done()

    it 'provides callback-based way of testing', (done) ->
      humock.test 'hello', (envelope, strings) ->
        expect(strings[0]).match /hello back/
        done()

    it 'provides promise-based way of testing', (done) ->
      humock.test('hello').then (response) ->
        expect(response.toString()).match /hello back/
        done()
1.1.0

8 years ago

1.0.6

9 years ago

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