-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
When supplying configuration in a test using injectCore, the configuration is overridden by the default configuration included in BlueOak Server, for example:
var testUtility = require('blueoak-server').testUtility();
var coreServices = ['config', 'logger'];
var testSpecificConfig = {
app: {
key: 'value'
}
};
testUtility.injectCore(coreServices, testSpecifcConfig, function (initializedModules) {
var config = initializedModules.config;
var logger = intializedModules.logger;
var appConfig = config.get('app');
// appConfig is {} instead of { key: 'value' }
});
Files that would possibly be affected by a fix for this:
https://github.com/BlueOakJS/blueoak-server/blob/master/testlib/util.js#L92
https://github.com/BlueOakJS/blueoak-server/blob/master/services/config.js#L18
In config.js, the fs.readFile block overrides any config passed into injectCore
Reactions are currently unavailable