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/semantic-commits-migration.spec.ts
2023-11-07 15:50:29 +00:00

60 lines
1.4 KiB
TypeScript

import { SemanticCommitsMigration } from './semantic-commits-migration';
describe('config/migrations/custom/semantic-commits-migration', () => {
it('should migrate true to "enabled"', () => {
expect(SemanticCommitsMigration).toMigrate(
{
semanticCommits: true,
} as any,
{ semanticCommits: 'enabled' },
);
});
it('should migrate false to "disabled"', () => {
expect(SemanticCommitsMigration).toMigrate(
{
semanticCommits: false,
} as any,
{ semanticCommits: 'disabled' },
);
});
it('should migrate null to "auto"', () => {
expect(SemanticCommitsMigration).toMigrate(
{
semanticCommits: null,
} as any,
{ semanticCommits: 'auto' },
);
});
it('should migrate random string to "auto"', () => {
expect(SemanticCommitsMigration).toMigrate(
{
semanticCommits: 'test',
} as any,
{ semanticCommits: 'auto' },
);
});
it('should not migrate valid enabled config', () => {
expect(SemanticCommitsMigration).toMigrate(
{
semanticCommits: 'enabled',
} as any,
{ semanticCommits: 'enabled' },
false,
);
});
it('should not migrate valid disabled config', () => {
expect(SemanticCommitsMigration).toMigrate(
{
semanticCommits: 'disabled',
} as any,
{ semanticCommits: 'disabled' },
false,
);
});
});