From c8691a85c5b237e1955ce4f132844a58686d44c2 Mon Sep 17 00:00:00 2001 From: Katharina Irrgang Date: Thu, 6 Oct 2016 21:40:01 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20tests:=20fix=20fork=20config?= =?UTF-8?q?=20(#7508)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #7506 --- core/test/utils/fork.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/test/utils/fork.js b/core/test/utils/fork.js index b1318ca619..18d10fc8e9 100644 --- a/core/test/utils/fork.js +++ b/core/test/utils/fork.js @@ -40,9 +40,7 @@ function findFreePort(port) { // Creates a new fork of Ghost process with a given config // Useful for tests that want to verify certain config options -function forkGhost(newConfig, envName) { - envName = envName || 'forked'; - +function forkGhost(newConfig) { return findFreePort() .then(function (port) { newConfig.server = _.merge({}, { @@ -61,7 +59,7 @@ function forkGhost(newConfig, envName) { rotation: false }; - var newConfigFile = path.join(config.get('paths').appRoot, 'config.test.' + envName + '.json'); + var newConfigFile = path.join(config.get('paths').appRoot, 'config.' + config.get('env') + '.json'); return new Promise(function (resolve, reject) { fs.writeFile(newConfigFile, JSON.stringify(newConfig), function (err) { @@ -84,7 +82,7 @@ function forkGhost(newConfig, envName) { return false; }; - env.NODE_ENV = 'test.' + envName; + env.NODE_ENV = config.get('env'); child = cp.fork(path.join(config.get('paths').appRoot, 'index.js'), {env: env});