Skip to content

Commit

Permalink
Fixes #55 - Callback optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
braddunbar authored and James Halliday committed Feb 21, 2014
1 parent 46c15be commit 61df434
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Test.prototype.run = function () {
}
this.emit('prerun');
try {
this._cb(this);
if (this._cb) this._cb(this);
else this.end();
}
catch (err) {
this.error(err);
Expand Down
3 changes: 3 additions & 0 deletions test/no_callback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var test = require('../');

test('No callback.');

0 comments on commit 61df434

Please sign in to comment.