2022-01-23 21:00:02 +00:00
|
|
|
import { ComposerIgnorePlatformReqsMigration } from './composer-ignore-platform-reqs-migration';
|
|
|
|
|
|
|
|
describe('config/migrations/custom/composer-ignore-platform-reqs-migration', () => {
|
|
|
|
it('should migrate true to empty array', () => {
|
|
|
|
expect(ComposerIgnorePlatformReqsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
composerIgnorePlatformReqs: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
composerIgnorePlatformReqs: [],
|
2023-11-07 15:50:29 +00:00
|
|
|
},
|
2022-01-23 21:00:02 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should migrate false to null', () => {
|
|
|
|
expect(ComposerIgnorePlatformReqsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
composerIgnorePlatformReqs: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
composerIgnorePlatformReqs: null,
|
2023-11-07 15:50:29 +00:00
|
|
|
},
|
2022-01-23 21:00:02 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not change array value', () => {
|
|
|
|
expect(ComposerIgnorePlatformReqsMigration).toMigrate(
|
|
|
|
{
|
|
|
|
composerIgnorePlatformReqs: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
composerIgnorePlatformReqs: [],
|
|
|
|
},
|
2023-11-07 15:50:29 +00:00
|
|
|
false,
|
2022-01-23 21:00:02 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|