testbot

1.0.1 • Public • Published

TESTBOT

Writing your hubot script?

Make unit tests with TESTBOT.

It's easy.

npm

hubot

Usage

Write your test-cases like

Testbot = require 'testbot'
assert = require 'assert'
 
describe 'hubot'->
  bot = null
 
  # create new bot before each test 
  beforeEach (done)->
    bot = new Testbot
    bot.load './src'['hello.coffee']done
 
  # clear bot after each test 
  afterEach ->
    do bot.clear
 
  # write your test cases 
  describe 'hello'->
    it 'should send world'(done)->
      bot.send 'hubot hello'(res)->
        assert.equal res"world"
        do done

and run with mocha

$ mocha
 
 
  hubot
    hello
      ✓ should send world
 
 
  1 passing (89ms)

Install

$ npm install testbot --save-dev

Package Sidebar

Install

npm i testbot

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mnpk