Skip to content

armgit / mocha

Public Imported from GitHub
0

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

misc

TJ Holowaychuk22aa3fd3bc3b
diff --git a/lib/runnable.js b/lib/runnable.js
index 9f75810b..beb46917 100644
--- a/lib/runnable.js
+++ b/lib/runnable.js
@@ -107,6 +107,8 @@ Runnable.prototype.run = function(fn){
, finished
, emitted;
+ if (ctx) ctx.runnable(this);
+
// timeout
if (this.async) {
if (ms) {
@@ -134,10 +136,6 @@ Runnable.prototype.run = function(fn){
fn(err);
}
- if (ctx) {
- ctx.runnable(this);
- }
-
// for .resetTimeout()
this.callback = done;