0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/modules/manager/range.spec.ts
Rhys Arkins 016e647390
feat(config)!: default to rangeStrategy=auto, prefer update-lockfile (#19942)
Changes `rangeStrategy` default value from `'replace'` to `'auto'`. Also changes `auto` behavior so that `update-lockfile` is preferred if the manager
supports the `updateLockedDependency()` function.

Closes #19800

BREAKING CHANGE: Renovate will now default to updating locked dependency versions. To revert to previous behavior, configure rangeStrategy=replace.
2023-03-10 09:25:45 +01:00

46 lines
1.2 KiB
TypeScript

import type { RangeConfig } from './types';
import { getRangeStrategy } from '.';
describe('modules/manager/range', () => {
it('returns same if not auto', () => {
const config: RangeConfig = {
manager: 'npm',
rangeStrategy: 'widen',
};
expect(getRangeStrategy(config)).toBe('widen');
});
it('returns manager strategy', () => {
const config: RangeConfig = {
manager: 'npm',
rangeStrategy: 'auto',
depType: 'dependencies',
};
expect(getRangeStrategy(config)).toBe('update-lockfile');
});
it('defaults to update-lockfile if updateLockedDependency() is supported', () => {
const config: RangeConfig = {
manager: 'bundler',
rangeStrategy: 'auto',
};
expect(getRangeStrategy(config)).toBe('update-lockfile');
});
it('defaults to replace', () => {
const config: RangeConfig = {
manager: 'sbt',
rangeStrategy: 'auto',
};
expect(getRangeStrategy(config)).toBe('replace');
});
it('returns rangeStrategy if not auto', () => {
const config: RangeConfig = {
manager: 'circleci',
rangeStrategy: 'future',
};
expect(getRangeStrategy(config)).toBe('future');
});
});