Files
renovate/lib/config/defaults.spec.ts
RahulGautamSingh 3b699b3698 feat: configure limiting security updates (#45574)
* configure limiting security updates

* separate security limit from other limits

* rename type

* fix coverage

* add comments

* add test
2026-09-03 06:08:37 +00:00

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();
},
);
});
});