Skip to content

Commit

Permalink
mochajs#1417 - displaying actual error instead of incorrect done() ca…
Browse files Browse the repository at this point in the history
…lled multiple times error
  • Loading branch information
davija committed Oct 12, 2015
1 parent 0c70277 commit 2ab7a78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/runnable.js
Expand Up @@ -314,7 +314,11 @@ Runnable.prototype.run = function(fn) {
}
return done(new Error('done() invoked with non-Error: ' + err));
}
done();
if (ctx && ctx.test) {
done(ctx.test.err);
} else {
done();
}
});
}
};

0 comments on commit 2ab7a78

Please sign in to comment.