0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/config/migrations/base/abstract-migration.spec.ts
2023-11-07 15:50:29 +00:00

40 lines
903 B
TypeScript

import { AbstractMigration } from './abstract-migration';
describe('config/migrations/base/abstract-migration', () => {
it('should not allow to use method rewrite', () => {
class CustomMigration extends AbstractMigration {
override readonly propertyName = /^foo/;
override run(): void {
this.rewrite(false);
}
}
const customMigration = new CustomMigration(
{
fooBar: true,
},
{},
);
expect(() => customMigration.run()).toThrow();
});
it('should not allow to use method delete', () => {
class CustomMigration extends AbstractMigration {
override readonly propertyName = /^foo/;
override run(): void {
this.delete();
}
}
const customMigration = new CustomMigration(
{
fooBar: true,
},
{},
);
expect(() => customMigration.run()).toThrow();
});
});