testbot
helper for testing hubot-scripts
Last updated 5 years ago by mnpk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install testbot 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.1                                ...           latest (5 years ago)

2 Versions

  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |