mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 13:38:32 +00:00
016e647390
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.
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import type { RangeConfig } from '../types';
|
|
import { getRangeStrategy } from '.';
|
|
|
|
describe('modules/manager/npm/range', () => {
|
|
it('returns same if not auto', () => {
|
|
const config: RangeConfig = { rangeStrategy: 'widen' };
|
|
expect(getRangeStrategy(config)).toBe('widen');
|
|
});
|
|
|
|
it('widens peerDependencies', () => {
|
|
const config: RangeConfig = {
|
|
rangeStrategy: 'auto',
|
|
depType: 'peerDependencies',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('widen');
|
|
});
|
|
|
|
it('widens complex ranges', () => {
|
|
const config: RangeConfig = {
|
|
rangeStrategy: 'auto',
|
|
depType: 'dependencies',
|
|
currentValue: '^1.6.0 || ^2.0.0',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('widen');
|
|
});
|
|
|
|
it('widens complex bump', () => {
|
|
const config: RangeConfig = {
|
|
rangeStrategy: 'bump',
|
|
depType: 'dependencies',
|
|
currentValue: '^1.6.0 || ^2.0.0',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('widen');
|
|
});
|
|
|
|
it('defaults to update-lockfile', () => {
|
|
const config: RangeConfig = {
|
|
rangeStrategy: 'auto',
|
|
depType: 'dependencies',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('update-lockfile');
|
|
});
|
|
});
|