Skip to content

Commit

Permalink
don't call nodeunit.complete in the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Caolan McMahon committed Oct 29, 2011
1 parent 081cbb7 commit bee4731
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/core.js
Expand Up @@ -14,7 +14,7 @@
*/

var async = require('../deps/async'), //@REMOVE_LINE_FOR_BROWSER
nodeunit = require('./nodeunit'), //@REMOVE_LINE_FOR_BROWSER
nodeunit = require('./nodeunit'), //@REMOVE_LINE_FOR_BROWSER
types = require('./types'); //@REMOVE_LINE_FOR_BROWSER


Expand Down Expand Up @@ -157,7 +157,9 @@ 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);
nodeunit.complete(name, assertion_list);
if (nodeunit.complete) {
nodeunit.complete(name, assertion_list);
}
callback(null, a_list);
});
};
Expand Down
4 changes: 2 additions & 2 deletions lib/nodeunit.js
Expand Up @@ -92,13 +92,13 @@ for (label in events.EventEmitter.prototype) {
/* Emit event 'complete' on completion of a test suite. */
exports.complete = function(name, assertions)
{
exports.emit('complete', name, assertions);
exports.emit('complete', name, assertions);
};

/* Emit event 'complete' on completion of all tests. */
exports.done = function()
{
exports.emit('done');
exports.emit('done');
};

module.exports = exports;

0 comments on commit bee4731

Please sign in to comment.