Skip to content

Commit

Permalink
Avoid calling done() twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
lrowe committed Feb 1, 2017
1 parent bc06b85 commit dae3428
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/runnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,11 @@ Runnable.prototype.run = function (fn) {
}

if (this.allowUncaught) {
callFn(this.fn);
done();
if (this.isPending()) {
done();
} else {
callFn(this.fn);
}
return;
}

Expand Down

0 comments on commit dae3428

Please sign in to comment.