2022-03-13 23:09:53 -06:00
|
|
|
import { AutomergePatchMigration } from './automerge-patch-migration';
|
|
|
|
|
|
|
|
describe('config/migrations/custom/automerge-patch-migration', () => {
|
|
|
|
it('should migrate value to object', () => {
|
|
|
|
expect(AutomergePatchMigration).toMigrate(
|
|
|
|
{
|
|
|
|
automergePatch: 'some-value',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
patch: {
|
|
|
|
automerge: true,
|
|
|
|
},
|
2023-11-07 08:50:29 -07:00
|
|
|
},
|
2022-03-13 23:09:53 -06:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should migrate value to object and concat with existing minor object', () => {
|
|
|
|
expect(AutomergePatchMigration).toMigrate(
|
|
|
|
{
|
|
|
|
automergePatch: 'some-value',
|
|
|
|
patch: {
|
2023-05-25 09:46:28 -06:00
|
|
|
matchFileNames: ['test'],
|
2022-03-13 23:09:53 -06:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
patch: {
|
|
|
|
automerge: true,
|
2023-05-25 09:46:28 -06:00
|
|
|
matchFileNames: ['test'],
|
2022-03-13 23:09:53 -06:00
|
|
|
},
|
2023-11-07 08:50:29 -07:00
|
|
|
},
|
2022-03-13 23:09:53 -06:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should ignore non object minor value', () => {
|
|
|
|
expect(AutomergePatchMigration).toMigrate(
|
|
|
|
{
|
|
|
|
automergePatch: 'some-value',
|
|
|
|
patch: null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
patch: {
|
|
|
|
automerge: true,
|
|
|
|
},
|
2023-11-07 08:50:29 -07:00
|
|
|
},
|
2022-03-13 23:09:53 -06:00
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|