diff --git a/lib/runner/runner.js b/lib/runner/runner.js index 513e45e654..da1966bac9 100644 --- a/lib/runner/runner.js +++ b/lib/runner/runner.js @@ -1,7 +1,6 @@ const TestSource = require('./test-source.js'); const Walker = require('./folder-walk.js'); const DefaultRunner = require('./test-runners/default.js'); -const MochaRunner = require('./test-runners/mocha.js'); class Runner { static get DEFAULT_RUNNER() { @@ -87,9 +86,11 @@ class Runner { return new DefaultRunner(settings, argv, addtOpts); case Runner.MOCHA_RUNNER: + const MochaRunner = require('./test-runners/mocha.js'); + return new MochaRunner(settings, argv, addtOpts); } } } -module.exports = Runner; \ No newline at end of file +module.exports = Runner; diff --git a/package.json b/package.json index f66182f3f3..e75888f4d7 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,14 @@ "coveralls": "^3.0.0", "eslint": "^5.2.0", "js-yaml": "^3.13.1", - "mocha": "^5.2.0", "mock-spawn": "^0.2.1", "mockery": "~2.1.0", "nock": "^10.0.6", - "nyc": "^14.0.0" + "nyc": "^14.0.0", + "mocha": "^5.2.0" + }, + "optionalDependencies": { + "mocha": "^5.2.0" }, "bin": { "nightwatch": "./bin/nightwatch"