2022-01-13 01:50:20 -07:00
|
|
|
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,
|
2023-11-07 08:50:29 -07:00
|
|
|
{ semanticCommits: 'enabled' },
|
2022-01-13 01:50:20 -07:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should migrate false to "disabled"', () => {
|
|
|
|
expect(SemanticCommitsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
semanticCommits: false,
|
|
|
|
} as any,
|
2023-11-07 08:50:29 -07:00
|
|
|
{ semanticCommits: 'disabled' },
|
2022-01-13 01:50:20 -07:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should migrate null to "auto"', () => {
|
|
|
|
expect(SemanticCommitsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
semanticCommits: null,
|
|
|
|
} as any,
|
2023-11-07 08:50:29 -07:00
|
|
|
{ semanticCommits: 'auto' },
|
2022-01-13 01:50:20 -07:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should migrate random string to "auto"', () => {
|
|
|
|
expect(SemanticCommitsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
semanticCommits: 'test',
|
|
|
|
} as any,
|
2023-11-07 08:50:29 -07:00
|
|
|
{ semanticCommits: 'auto' },
|
2022-01-13 01:50:20 -07:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not migrate valid enabled config', () => {
|
|
|
|
expect(SemanticCommitsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
semanticCommits: 'enabled',
|
|
|
|
} as any,
|
|
|
|
{ semanticCommits: 'enabled' },
|
2023-11-07 08:50:29 -07:00
|
|
|
false,
|
2022-01-13 01:50:20 -07:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not migrate valid disabled config', () => {
|
|
|
|
expect(SemanticCommitsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
semanticCommits: 'disabled',
|
|
|
|
} as any,
|
|
|
|
{ semanticCommits: 'disabled' },
|
2023-11-07 08:50:29 -07:00
|
|
|
false,
|
2022-01-13 01:50:20 -07:00
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|