Skip to content

armgit / mocha

Public Imported from GitHub
0

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

nextTick() in runTest() to shorten stack traces

Tj Holowaychukaaca2fbafe3f
diff --git a/lib/runner.js b/lib/runner.js
index e3aa622d..f0421508 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -165,8 +165,10 @@ Runner.prototype.runTest = function(fn){
// async
if (test.async) return test.run(fn);
// sync
- test.run();
- fn();
+ process.nextTick(function(){
+ test.run();
+ fn();
+ });
} catch (err) {
fn(err);
}