Skip to content

Commit

Permalink
Runner: Read config from configFile if no basedir
Browse files Browse the repository at this point in the history
Example fix for krakenjs#53
  • Loading branch information
dwbruhn committed Dec 8, 2018
1 parent aaec89b commit 63e6126
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = function master(Nemo) {
log('single kickoff with instance %O', iconfig.tags);
process.env = Object.assign({}, process.env, iconfig.conf.env || {});
iconfig.tags.uid = uuid();
return instance({basedir: Nemo.program.baseDirectory, profile: iconfig, __dirname: __dirname}, err => {
return instance({basedir: Nemo.program.baseDirectory, configFile: Nemo.program.configFile, profile: iconfig, __dirname: __dirname}, err => {
if (err) {
console.error(err);
}
Expand Down
6 changes: 4 additions & 2 deletions lib/runner/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ function MochaRunner(runnerConfig) {
});
}
// plain JS config use case
return NemoCore.Configure({
// no instanceConfig.basedir, so read config from instanceConfig.configFile instead
let JSConfig = require(instanceConfig.configFile);
return NemoCore.Configure(Object.assign({}, JSConfig, {
driver: driverConf,
data: dataConf
});
}));
})
.then((nemoCoreConfig) => {
NemoBaseConfig.merge(nemoCoreConfig);
Expand Down

0 comments on commit 63e6126

Please sign in to comment.