0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/config/migrations/custom/go-mod-tidy-migration.spec.ts
2023-11-07 15:50:29 +00:00

36 lines
783 B
TypeScript

import { GoModTidyMigration } from './go-mod-tidy-migration';
describe('config/migrations/custom/go-mod-tidy-migration', () => {
it('should add postUpdateOptions option when true', () => {
expect(GoModTidyMigration).toMigrate(
{
gomodTidy: true,
postUpdateOptions: ['test'],
},
{
postUpdateOptions: ['test', 'gomodTidy'],
},
);
});
it('should handle case when postUpdateOptions is not defined ', () => {
expect(GoModTidyMigration).toMigrate(
{
gomodTidy: true,
},
{
postUpdateOptions: ['gomodTidy'],
},
);
});
it('should only remove when false', () => {
expect(GoModTidyMigration).toMigrate(
{
gomodTidy: false,
},
{},
);
});
});