# kakashi

> A test driver for Hubot scripts.

Latest version **0.3.2** (published 2014-07-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install kakashi
pnpm add kakashi
yarn add kakashi
bun add kakashi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2014-07-23 |
| First published | 2014-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | bouzuya |
| Maintainers | bouzuya |
| Keywords | hubot, test |

## Links

- npm: https://www.npmjs.com/package/kakashi
- Repository: https://github.com/bouzuya/kakashi
- Issues: https://github.com/bouzuya/kakashi/issues
- npm.io page: https://npm.io/package/kakashi

## Dependencies (3)

- [q](https://npm.io/package/q.md) ^1.0.1
- [hubot](https://npm.io/package/hubot.md) ^2.7.5
- [sinon](https://npm.io/package/sinon.md) ^1.10.3

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.3.2 (latest) — 2014-07-23
- 0.3.1 — 2014-07-23
- 0.3.0 — 2014-07-19
- 0.2.0 — 2014-07-13
- 0.1.3 — 2014-07-12
- 0.1.2 — 2014-07-12
- 0.1.1 — 2014-07-12

## README

# kakashi

A test driver for [Hubot][hubot] scripts.

## Installation

    $ npm install kakashi

## Example

### hello.js

```javascript
module.exports = function(robot) {
  robot.respond(/hello$/, function(res) {
    res.send('hello!');
  });
};
```

### test/hello.js

(for mocha)

```javascript
var Kakashi = require('kakashi').Kakashi;

describe('hello', function() {
  beforeEach(function(done) {
    this.kakashi = new Kakashi();
    this.kakashi.scripts = [require('../hello.js')];
    this.kakashi.users = [{ id: 'bouzuya', room: 'hitoridokusho' }];
    this.kakashi.start().then(done, done);
  });

  afterEach(function(done) {
    this.kakashi.stop().then(done, done);
  });

  describe('receive "hello"', function() {
    it('send "hello!"', function(done) {
      this.kakashi
        .receive({ room: 'my-room' }, 'hello')
        .then(function() {
          expect(this.kakashi.send.firstCall.args[1]).to
            .equal('hello!');
        }.bind(this))
        .then(done, done);
    });
  });
});
```

[See example (bouzuya/hubot-url)][bouzuya/hubot-url]

## License

MIT

[bouzuya/hubot-url]: https://github.com/bouzuya/hubot-url
[hubot]: https://github.com/github/hubot

---
_Source: https://npm.io/package/kakashi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
