Skip to content

armgit / mocha

Public Imported from GitHub
0

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

more nextTick()s to shorten stack traces

Tj Holowaychuk484432a15ad8
diff --git a/lib/runner.js b/lib/runner.js
index f0421508..2bfbe1c1 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -141,13 +141,17 @@ Runner.prototype.hook = function(name, fn){
// serial
try {
callback();
- next(++i);
+ process.nextTick(function(){
+ next(++i);
+ });
} catch (err) {
fn(err);
}
}
- next(0);
+ process.nextTick(function(){
+ next(0);
+ });
};
/**