mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 14:36:25 +00:00
fix: handle null child config in merge (#790)
This commit is contained in:
parent
37f3acf657
commit
d6a45e5f47
2 changed files with 9 additions and 0 deletions
|
@ -113,6 +113,9 @@ async function parseConfigs(env, argv) {
|
|||
|
||||
function mergeChildConfig(parentConfig, childConfig) {
|
||||
logger.trace({ parentConfig, childConfig }, `mergeChildConfig`);
|
||||
if (!childConfig) {
|
||||
return parentConfig;
|
||||
}
|
||||
const config = { ...parentConfig, ...childConfig };
|
||||
for (const option of definitions.getOptions()) {
|
||||
if (
|
||||
|
|
|
@ -209,5 +209,11 @@ describe('config/index', () => {
|
|||
const config = configParser.mergeChildConfig(parentConfig, {});
|
||||
expect(config.packageRules).toHaveLength(2);
|
||||
});
|
||||
it('handles undefined childConfig', () => {
|
||||
const parentConfig = { ...defaultConfig };
|
||||
const configParser = require('../../lib/config/index.js');
|
||||
const config = configParser.mergeChildConfig(parentConfig, undefined);
|
||||
expect(config).toMatchObject(parentConfig);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue