mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
b89f448946
Validates that each packageRule must contain at least one selector. Resolves the rule first to allow for presets. Closes #1345, Closes #1693
27 lines
836 B
JavaScript
27 lines
836 B
JavaScript
const { migrateAndValidate } = require('../../lib/config/migrate-validate');
|
|
|
|
let config;
|
|
beforeEach(() => {
|
|
jest.resetAllMocks();
|
|
config = { ...require('../_fixtures/config') };
|
|
});
|
|
|
|
describe('config/migrate-validate', () => {
|
|
describe('migrateAndValidate()', () => {
|
|
it('handles empty', async () => {
|
|
const res = await migrateAndValidate(config, {});
|
|
expect(res).toMatchSnapshot();
|
|
});
|
|
it('handles migration', async () => {
|
|
const input = { automerge: 'none' };
|
|
const res = await migrateAndValidate(config, input);
|
|
expect(res).toMatchSnapshot();
|
|
});
|
|
it('handles invalid', async () => {
|
|
const input = { foo: 'none' };
|
|
const res = await migrateAndValidate(config, input);
|
|
expect(res).toMatchSnapshot();
|
|
expect(res.errors).toHaveLength(1);
|
|
});
|
|
});
|
|
});
|