mochainon
v2.0.0
Published
Opitionated way to get up and running quickly with Mocha, Chai and Sinon
Downloads
13,196
Readme
mochainon
Opitionated way to get up and running quickly with Mocha, Chai and Sinon.
Why?
I found myself doing the same time consuming pattern requiring Mocha, Sinon, Chai and various plugins.
This is an attempt to save a minute of my life every time I create a test file.
Future
In the future, I intend to keep extending this module with custom chai helpers and other goodies that can reduce the time I spend unit testing.
Installation
Install mochainon
as a development dependency by running:
$ npm install --save-dev mochainon
Usage
I recommend requiring this module as a single letter variable, like m
, and use it's functionality from there.
Example:
m = require('mochainon')
describe 'My Spec', ->
it 'should pass', ->
m.expect(true).to.be.true
Documentation
The module exposes the following objects:
mochainon.sinon
The awesome spies, stubs and mocks library SinonJS.
mochainon.chai
The powerfull assertion library Chai.
Plugins
This module also includes the following Chai plugins I use on a daily basis:
Tests
Run the test suite by doing:
$ gulp test
Contribute
- Issue Tracker: github.com/jviotti/mochainon/issues
- Source Code: github.com/jviotti/mochainon
Before submitting a PR, please make sure that coffeelint runs without any warning:
$ gulp lint
Support
If you're having any problem, please raise an issue on GitHub.
License
The project is licensed under the MIT license.