https://github.com/hermanya/mock-hubot
Hubot mock library made dead simple
https://github.com/hermanya/mock-hubot
Last synced: 8 months ago
JSON representation
Hubot mock library made dead simple
- Host: GitHub
- URL: https://github.com/hermanya/mock-hubot
- Owner: Hermanya
- Created: 2015-01-06T23:24:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-01-27T16:17:22.000Z (over 8 years ago)
- Last Synced: 2024-12-28T03:42:12.297Z (over 1 year ago)
- Language: CoffeeScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Mock-hubot
==========
This is a simple wrapper library around [hubot-mock-adapter](https://github.com/blalor/hubot-mock-adapter).
###How to use
`$ npm install --save-dev mock-hubot`
[Assume we were to test this script.](test/hello-script.coffee)
```
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()
```