0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-11 13:48:55 +00:00
renovatebot_renovate/lib/config/migrations/custom/semantic-prefix-migration.spec.ts
2023-11-07 15:50:29 +00:00

39 lines
1,001 B
TypeScript

import { SemanticPrefixMigration } from './semantic-prefix-migration';
describe('config/migrations/custom/semantic-prefix-migration', () => {
it('should work', () => {
expect(SemanticPrefixMigration).toMigrate(
{
semanticPrefix: 'fix(deps): ',
} as any,
{ semanticCommitType: 'fix', semanticCommitScope: 'deps' },
);
});
it('should remove non-string values', () => {
expect(SemanticPrefixMigration).toMigrate(
{
semanticPrefix: true,
} as any,
{},
);
});
it('should migrate prefix with no-scope to null', () => {
expect(SemanticPrefixMigration).toMigrate(
{
semanticPrefix: 'fix: ',
} as any,
{ semanticCommitType: 'fix', semanticCommitScope: null },
);
});
it('works for random string', () => {
expect(SemanticPrefixMigration).toMigrate(
{
semanticPrefix: 'test',
} as any,
{ semanticCommitType: 'test', semanticCommitScope: null },
);
});
});