mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-27 15:58:48 +00:00
3b699b3698
* configure limiting security updates * separate security limit from other limits * rename type * fix coverage * add comments * add test
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { getConfig, getDefault } from './defaults.ts';
|
|
import type { RenovateOptions } from './types.ts';
|
|
|
|
describe('config/defaults', () => {
|
|
describe('getConfig()', () => {
|
|
it('leaves the vulnerabilityAlerts concurrent limit unlimited', () => {
|
|
expect(getConfig().vulnerabilityAlerts).toMatchObject({
|
|
prConcurrentLimit: 0,
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('getDefault()', () => {
|
|
it('returns new instances of arrays when called repeatedly', () => {
|
|
const option: RenovateOptions = {
|
|
type: 'array',
|
|
description: 'thing',
|
|
name: 'thing',
|
|
};
|
|
const array1 = getDefault(option);
|
|
const array2 = getDefault(option);
|
|
|
|
// Equal values, different objects
|
|
expect(array2).toEqual(array2);
|
|
expect(array1).not.toBe(array2);
|
|
});
|
|
|
|
it('returns true for boolean values', () => {
|
|
const option: RenovateOptions = {
|
|
type: 'boolean',
|
|
description: 'thing',
|
|
name: 'thing',
|
|
};
|
|
const val = getDefault(option);
|
|
|
|
expect(val).toBe(true);
|
|
});
|
|
|
|
it.each(['string', 'object', 'integer'])(
|
|
'returns null for %s values',
|
|
(type: string) => {
|
|
const option: RenovateOptions = {
|
|
type: type as 'string' | 'object' | 'integer',
|
|
description: 'thing',
|
|
name: 'thing',
|
|
};
|
|
const val = getDefault(option);
|
|
|
|
expect(val).toBeNull();
|
|
},
|
|
);
|
|
});
|
|
});
|