mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
27 lines
800 B
JavaScript
27 lines
800 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', () => {
|
|
const res = migrateAndValidate(config, {});
|
|
expect(res).toMatchSnapshot();
|
|
});
|
|
it('handles migration', () => {
|
|
const input = { automerge: 'none' };
|
|
const res = migrateAndValidate(config, input);
|
|
expect(res).toMatchSnapshot();
|
|
});
|
|
it('handles invalid', () => {
|
|
const input = { foo: 'none' };
|
|
const res = migrateAndValidate(config, input);
|
|
expect(res).toMatchSnapshot();
|
|
expect(res.errors).toHaveLength(1);
|
|
});
|
|
});
|
|
});
|