Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Simplify function call.

Sorin Iclanzan5a18d67e7256
diff --git a/lib/mocha.js b/lib/mocha.js
index eb6c8d07..a47e92dc 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();
};
/**