0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/config/migrations/custom/branch-prefix-migration.spec.ts
2023-11-07 15:50:29 +00:00

40 lines
861 B
TypeScript

import { BranchPrefixMigration } from './branch-prefix-migration';
describe('config/migrations/custom/branch-prefix-migration', () => {
it('should migrate template', () => {
expect(BranchPrefixMigration).toMigrate(
{
branchPrefix: 'renovate/{{parentDir}}-',
},
{
additionalBranchPrefix: '{{parentDir}}-',
branchPrefix: 'renovate/',
},
);
});
it('should ignore string without template', () => {
expect(BranchPrefixMigration).toMigrate(
{
branchPrefix: 'test',
},
{
branchPrefix: 'test',
},
false,
);
});
it('should ignore non string without template', () => {
expect(BranchPrefixMigration).toMigrate(
{
branchPrefix: true,
} as any,
{
branchPrefix: true,
} as any,
false,
);
});
});