0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/config/migrations/custom/packages-migration.spec.ts
Rhys Arkins 879f7cc212 feat(packageRules): migrate matchers and excludes (#28602)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-07-25 15:28:16 +02:00

39 lines
981 B
TypeScript

import { PackagesMigration } from './packages-migration';
describe('config/migrations/custom/packages-migration', () => {
it('should migrate to package rules', () => {
expect(PackagesMigration).toMigrate(
{
packages: [{ matchPackageNames: ['*'] }],
},
{
packageRules: [{ matchPackageNames: ['*'] }],
},
);
});
it('should concat with existing package rules', () => {
expect(PackagesMigration).toMigrate(
{
packages: [{ matchPackageNames: ['*'] }],
packageRules: [{ matchPackageNames: [] }],
},
{
packageRules: [{ matchPackageNames: [] }, { matchPackageNames: ['*'] }],
},
);
});
it('should ignore non array value', () => {
expect(PackagesMigration).toMigrate(
{
packages: { matchPackageNames: ['*'] },
packageRules: [{ matchPackageNames: [] }],
},
{
packageRules: [{ matchPackageNames: [] }],
},
);
});
});