mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(packageRules): get packageFile from depTypeConfig
This commit is contained in:
parent
898b913f3b
commit
2606219485
2 changed files with 5 additions and 4 deletions
|
@ -49,7 +49,8 @@ async function renovateDepType(packageContent, config) {
|
|||
}
|
||||
|
||||
function getDepConfig(depTypeConfig, dep) {
|
||||
const { depName: dependency, packageFile } = dep;
|
||||
const { depName: dependency } = dep;
|
||||
const { packageFile } = depTypeConfig;
|
||||
let depConfig = configParser.mergeChildConfig(depTypeConfig, dep);
|
||||
// Apply any matching package rules
|
||||
if (depConfig.packageRules) {
|
||||
|
|
|
@ -310,6 +310,7 @@ describe('lib/workers/package-file/dep-type', () => {
|
|||
});
|
||||
it('matches paths', () => {
|
||||
const config = {
|
||||
packageFile: 'examples/foo/package.json',
|
||||
packageRules: [
|
||||
{
|
||||
paths: ['examples/**', 'lib/'],
|
||||
|
@ -319,17 +320,16 @@ describe('lib/workers/package-file/dep-type', () => {
|
|||
};
|
||||
const res1 = depTypeWorker.getDepConfig(config, {
|
||||
depName: 'test',
|
||||
packageFile: 'examples/foo/package.json',
|
||||
});
|
||||
expect(res1.x).toBeDefined();
|
||||
config.packageFile = 'package.json';
|
||||
const res2 = depTypeWorker.getDepConfig(config, {
|
||||
depName: 'test',
|
||||
packageFile: 'package.json',
|
||||
});
|
||||
expect(res2.x).toBeUndefined();
|
||||
config.packageFile = 'lib/a/package.json';
|
||||
const res3 = depTypeWorker.getDepConfig(config, {
|
||||
depName: 'test',
|
||||
packageFile: 'lib/a/package.json',
|
||||
});
|
||||
expect(res3.x).toBeDefined();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue