mirror of
https://github.com/renovatebot/renovate.git
synced 2025-05-12 23:51:55 +00:00

Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com> Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-authored-by: Rhys Arkins <rhys@arkins.net>
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { FileMatchMigration } from './file-match-migration';
|
|
|
|
describe('config/migrations/custom/file-match-migration', () => {
|
|
it('migrates fileMatch of type string', () => {
|
|
expect(FileMatchMigration).toMigrate(
|
|
{
|
|
fileMatch: 'filename',
|
|
},
|
|
{
|
|
managerFilePatterns: ['/filename/'],
|
|
},
|
|
);
|
|
});
|
|
|
|
it('migrates fileMatch of type array', () => {
|
|
expect(FileMatchMigration).toMigrate(
|
|
{
|
|
fileMatch: ['filename1', 'filename2'],
|
|
},
|
|
{
|
|
managerFilePatterns: ['/filename1/', '/filename2/'],
|
|
},
|
|
);
|
|
});
|
|
|
|
it('concats fileMatch to managerFilePatterns', () => {
|
|
expect(FileMatchMigration).toMigrate(
|
|
{
|
|
fileMatch: ['filename1', 'filename2'],
|
|
managerFilePatterns: ['filename3'],
|
|
},
|
|
{
|
|
managerFilePatterns: ['/filename1/', '/filename2/', 'filename3'],
|
|
},
|
|
);
|
|
});
|
|
|
|
it('does nothing if fileMatch not defined', () => {
|
|
expect(FileMatchMigration).toMigrate(
|
|
{
|
|
managerFilePatterns: ['filename3'],
|
|
},
|
|
{
|
|
managerFilePatterns: ['filename3'],
|
|
},
|
|
false,
|
|
);
|
|
});
|
|
});
|