From 714167dd0d236ff2d7685ef74205d561b116dcf7 Mon Sep 17 00:00:00 2001 From: Ronen Amiel Date: Wed, 13 Sep 2017 16:09:42 +0300 Subject: [PATCH] fix(frameworks): make mocha globals available on onPrepare, similarly to how it works on other frameworks --- lib/frameworks/mocha.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/frameworks/mocha.js b/lib/frameworks/mocha.js index d7d7f1d16..187bc426b 100644 --- a/lib/frameworks/mocha.js +++ b/lib/frameworks/mocha.js @@ -75,13 +75,13 @@ exports.run = function(runner, specs) { } }); + specs.forEach(function(file) { + mocha.addFile(file); + }); + mocha.loadFiles(); runner.runTestPreparer().then(function() { - specs.forEach(function(file) { - mocha.addFile(file); - }); - var testResult = []; var mochaRunner = mocha.run(function(failures) {