diff --git a/lib/mocha.js b/lib/mocha.js index eb6c8d077f..a47e92dc27 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -209,14 +209,13 @@ Mocha.prototype.ui = function(name) { Mocha.prototype.loadFiles = function(fn) { var self = this; var suite = this.suite; - var pending = this.files.length; this.files.forEach(function(file) { file = path.resolve(file); suite.emit('pre-require', global, file, self); suite.emit('require', require(file), file, self); suite.emit('post-require', global, file, self); - --pending || (fn && fn()); }); + fn && fn(); }; /**