Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sinsoku/hubot-mock-adapter-helper
https://github.com/sinsoku/hubot-mock-adapter-helper
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/sinsoku/hubot-mock-adapter-helper
- Owner: sinsoku
- License: mit
- Created: 2014-10-26T15:49:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-28T15:34:18.000Z (about 10 years ago)
- Last Synced: 2024-10-31T08:47:45.174Z (about 2 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 0
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hubot-mock-adapter-helper
A helper for [hubot-mock-adapter](https://github.com/blalor/hubot-mock-adapter).
## Installation
Install with [npm](https://www.npmjs.org/):
$ npm install hubot-mock-adapter-helper --save-dev
## Example
You can write the test code in this way.
```coffeescript
expect = require('chai').expect
helper = require 'hubot-mock-adapter-helper'TextMessage = require('hubot/src/message').TextMessage
describe 'ping', ->
{robot, user, adapter} = {}beforeEach (done) ->
helper.setupRobot (ret) ->
{robot, user, adapter} = ret
done()afterEach ->
robot.shutdown()it 'responds "PONG"', (done) ->
adapter.on 'reply', (envelope, strings) ->
expect(envelope.user.name).to.equal('mocha')
expect(strings[0]).to.equal('PONG')
, doneadapter.receive(new TextMessage(user, 'hubot ping'))
```