Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Fixed return on immediate async error. Closes #80

Tj Holowaychuk58b36026bbfd
diff --git a/lib/runner.js b/lib/runner.js
index 1d9546db..589de1eb 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -251,7 +251,7 @@ Runner.prototype.runTest = function(fn){
// async
if (test.async) {
try {
- return test.run(function(err){
+ test.run(function(err){
if (test.finished) {
self.fail(test, new Error('done() called multiple times'));
return;
@@ -261,6 +261,8 @@ Runner.prototype.runTest = function(fn){
} catch (err) {
fn(err);
}
+
+ return;
}
// sync