Get the current configuration value for a label
Configuration label to search for
Find which configuration file a current configuration value comes from.
Configuration label to search for
The configuration file the value originates from
Programatically set a configuration entry
Configuration label to set
Apply a default configuration from a given configuration file to a configuration sub-path.
This will always be applied prior to loading user-land configuration files.
Example:
var moduleName = 'myModule';
var configAccessPath = 'modules.' + moduleName
var defaultConfigFilePath = path.join(process.cwd(), 'lib/modules', moduleName, 'config.yaml')
mage.core.config.setTopLevelDefault(configAccessPath, defaultConfigFilePath);
MAGE configuration
Configuration can be required directly before requiring MAGE in cases where you wish to apply your own custom configuration.
const config = require('mage/lib/config'); config.set('some.path.to.config', 1) config.set(['some', 'other', 'path'], 1) const mage = require('mage'); // continue with your test code
See: https://mage.github.io/mage/#dynamic-configuration