diff options
author | Sergei Zharinov <[email protected]> | 2024-12-12 16:40:20 -0300 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-12 19:40:20 +0000 |
commit | 861321fbbe9b9d4a73d30265b9268864ed207777 (patch) | |
tree | 3749182f001c5c5ec3e383a9bbeeb2e3d3a2fe5f | |
parent | 32d72fe5f3900ecf0bc33b9988d36d66d87946f8 (diff) | |
download | renovate-861321fbbe9b9d4a73d30265b9268864ed207777.tar.gz renovate-861321fbbe9b9d4a73d30265b9268864ed207777.zip |
test: Use correct fields for `PackageRule` type (#33072)
-rw-r--r-- | lib/config/index.spec.ts | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/config/index.spec.ts b/lib/config/index.spec.ts index d8d81d4e262..13fd4ac4fc9 100644 --- a/lib/config/index.spec.ts +++ b/lib/config/index.spec.ts @@ -32,14 +32,23 @@ describe('config/index', () => { it('merges packageRules', () => { const parentConfig = { ...defaultConfig }; Object.assign(parentConfig, { - packageRules: [{ a: 1 }, { a: 2 }], + packageRules: [ + { matchPackageNames: ['pkg1'] }, + { matchPackageNames: ['pkg2'] }, + ], }); const childConfig = { - packageRules: [{ a: 3 }, { a: 4 }], + packageRules: [ + { matchPackageNames: ['pkg3'] }, + { matchPackageNames: ['pkg4'] }, + ], }; const config = mergeChildConfig(parentConfig, childConfig); - expect(config.packageRules.map((rule) => rule.a)).toMatchObject([ - 1, 2, 3, 4, + expect(config.packageRules).toMatchObject([ + { matchPackageNames: ['pkg1'] }, + { matchPackageNames: ['pkg2'] }, + { matchPackageNames: ['pkg3'] }, + { matchPackageNames: ['pkg4'] }, ]); }); @@ -95,9 +104,15 @@ describe('config/index', () => { it('handles null child packageRules', () => { const parentConfig = { ...defaultConfig }; - parentConfig.packageRules = [{ a: 3 }, { a: 4 }]; + parentConfig.packageRules = [ + { matchPackageNames: ['pkg1'] }, + { matchPackageNames: ['pkg2'] }, + ]; const config = mergeChildConfig(parentConfig, {}); - expect(config.packageRules).toHaveLength(2); + expect(config.packageRules).toMatchObject([ + { matchPackageNames: ['pkg1'] }, + { matchPackageNames: ['pkg2'] }, + ]); }); it('handles undefined childConfig', () => { |