Skip to content

Commit

Permalink
test: ensure presence of CustomMigrationClasses in `customMigration…
Browse files Browse the repository at this point in the history
…s` (#24171)
  • Loading branch information
RahulGautamSingh authored Aug 31, 2023
1 parent 7bc1f61 commit cfd680d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/config/migrations/migrations-service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import fs from 'node:fs';
import { join } from 'upath';
import type { RenovateConfig } from '../types';
import { AbstractMigration } from './base/abstract-migration';
import { MigrationsService } from './migrations-service';
Expand Down Expand Up @@ -97,4 +99,15 @@ describe('config/migrations/migrations-service', () => {
}
expect(duplicateProperties).toBeEmptyArray();
});

it('includes all defined migration classes in MigrationsService.customMigrations', () => {
const allDefinedMigrationClasses: string[] = fs
.readdirSync(join(__dirname, 'custom'), { withFileTypes: true })
.map((file) => file.name)
.filter((name) => !name.includes('spec.ts'));

expect(MigrationsService.customMigrations).toHaveLength(
allDefinedMigrationClasses.length
);
});
});

0 comments on commit cfd680d

Please sign in to comment.