diff --git a/lib/mocha.js b/lib/mocha.js index a224112b4d..730229c3b7 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -367,5 +367,14 @@ Mocha.prototype.run = function(fn){ if (options.growl) this._growl(runner, reporter); exports.reporters.Base.useColors = options.useColors; exports.reporters.Base.inlineDiffs = options.useInlineDiffs; - return runner.run(fn); + + function done(failures) { + if (reporter.done) { + reporter.done(failures, fn); + } else { + fn(failures); + } + } + + return runner.run(done); };