From 8b5f5e58f4405d7143c2e8964bd4dd5f368eb069 Mon Sep 17 00:00:00 2001 From: Christian Budde Christensen Date: Sat, 13 Feb 2016 18:18:58 +0100 Subject: [PATCH] fix: Setting default value for config in runner and stopper Default config to empty Object if undefined. --- lib/runner.js | 2 ++ lib/stopper.js | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/runner.js b/lib/runner.js index d09f537e6..5f74cd199 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -31,6 +31,8 @@ var parseExitCode = function (buffer, defaultCode, failOnEmptyTestSuite) { // TODO(vojta): read config file (port, host, urlRoot) exports.run = function (config, done) { + config = config || {} + logger.setupFromConfig(config) done = helper.isFunction(done) ? done : process.exit diff --git a/lib/stopper.js b/lib/stopper.js index c2a839a0c..3f0d72cfc 100644 --- a/lib/stopper.js +++ b/lib/stopper.js @@ -5,6 +5,7 @@ var logger = require('./logger') var helper = require('./helper') exports.stop = function (config, done) { + config = config || {} logger.setupFromConfig(config) done = helper.isFunction(done) ? done : process.exit var log = logger.create('stopper')