GithubHelp home page GithubHelp logo

mock-hubot's Introduction

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()

mock-hubot's People

Contributors

hermanya avatar makii42 avatar

Watchers

 avatar  avatar  avatar

mock-hubot's Issues

Error: Cannot find module 'hubot-mock-adapter'

Trying to run the following Jasmine test after npm install --save-dev mock-hubot :

bot = require 'mock-hubot'
script = require '../src/script.coffee'

describe 'testing', ->
  beforeEach ->
    bot.start ->
      bot.learn script

  it 'passes', ->
    expect(true).toBe(true)

I'm getting the following error :

Started
[Wed Sep 09 2015 23:33:31 GMT+0700 (WIB)] ERROR Cannot load adapter mock-adapter - Error: Cannot find module 'hubot-mock-adapter'

Any idea what's wrong ? I think I'm missing something simple, but I'm not sure what.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.