renovate/lib/modules/manager/range.spec.ts

38 lines
949 B
TypeScript
Raw Normal View History

2021-03-02 20:44:55 +00:00
import type { RangeConfig } from './types';
2020-05-01 16:03:48 +00:00
import { getRangeStrategy } from '.';
describe('modules/manager/range', () => {
it('returns same if not auto', () => {
const config: RangeConfig = {
manager: 'npm',
rangeStrategy: 'widen',
};
2021-11-08 12:16:58 +00:00
expect(getRangeStrategy(config)).toBe('widen');
});
it('returns manager strategy', () => {
const config: RangeConfig = {
manager: 'npm',
rangeStrategy: 'auto',
depType: 'dependencies',
};
expect(getRangeStrategy(config)).toBe('replace');
});
it('defaults to replace', () => {
const config: RangeConfig = {
manager: 'circleci',
rangeStrategy: 'auto',
};
2021-11-08 12:16:58 +00:00
expect(getRangeStrategy(config)).toBe('replace');
});
it('returns rangeStrategy if not auto', () => {
const config: RangeConfig = {
manager: 'circleci',
rangeStrategy: 'future',
};
2021-11-08 12:16:58 +00:00
expect(getRangeStrategy(config)).toBe('future');
});
});