mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +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) {
|
function mergeChildConfig(parentConfig, childConfig) {
|
||||||
logger.trace({ parentConfig, childConfig }, `mergeChildConfig`);
|
logger.trace({ parentConfig, childConfig }, `mergeChildConfig`);
|
||||||
|
if (!childConfig) {
|
||||||
|
return parentConfig;
|
||||||
|
}
|
||||||
const config = { ...parentConfig, ...childConfig };
|
const config = { ...parentConfig, ...childConfig };
|
||||||
for (const option of definitions.getOptions()) {
|
for (const option of definitions.getOptions()) {
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -209,5 +209,11 @@ describe('config/index', () => {
|
||||||
const config = configParser.mergeChildConfig(parentConfig, {});
|
const config = configParser.mergeChildConfig(parentConfig, {});
|
||||||
expect(config.packageRules).toHaveLength(2);
|
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