renovate/lib/config/migrations/custom/branch-prefix-migration.spe...

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,
);
});
});