Skip to content

Commit

Permalink
Merge pull request caolan#85 from alexgorbatchev/master
Browse files Browse the repository at this point in the history
Added 'complete' event to nodeunit
  • Loading branch information
Caolan McMahon committed Oct 29, 2011
2 parents 74a3281 + 8d2609f commit 6260c43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ exports.runModule = function (name, mod, opt, callback) {
var end = new Date().getTime();
var assertion_list = types.assertionList(a_list, end - start);
options.moduleDone(name, assertion_list);
require('./nodeunit').complete();
callback(null, a_list);
});
};
Expand Down
12 changes: 11 additions & 1 deletion lib/nodeunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ var async = require('../deps/async'),
core = require('./core'),
reporters = require('./reporters'),
assert = require('./assert'),
path = require('path');
path = require('path')
events = require('events');


/**
* Export sub-modules.
*/

exports = new events.EventEmitter();

exports.types = types;
exports.utils = utils;
exports.reporters = reporters;
Expand Down Expand Up @@ -80,3 +83,10 @@ exports.runFiles = function (paths, opt) {
});

};

exports.complete = function()
{
exports.emit('complete');
};

module.exports = exports;

0 comments on commit 6260c43

Please sign in to comment.