Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed May 31, 2014
1 parent 1324640 commit 5dc619b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ describe('#dispatcher()', function () {
done();
});
});
describe('when a faulty action is provided', function () {
it('should throw', function (done) {
var dispatcher = Dispatcher();
dispatcher.register.bind(123, function() {return 3})
.should.throw('dispatcher.register: action must be a string');
done();
});
});
describe('when a faulty callback is provided', function () {
it('should throw', function (done) {
var dispatcher = Dispatcher();
dispatcher.register.bind('hello', 'not a function')
.should.throw('dispatcher.register: callback must be a function');
done();
});
});

describe('.register()', function () {
it('should save the action', function (done) {
Expand Down

0 comments on commit 5dc619b

Please sign in to comment.