mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 09:06:25 +00:00
cbca54d0c3
Removes all logic where rangeStrategy=auto results in pinning. Closes #18304 BREAKING CHANGE: Dependencies are no longer automatically pinned, pinning must be opted into using rangeStrategy=pin
59 lines
1.5 KiB
TypeScript
59 lines
1.5 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('replaces devDependencies', () => {
|
|
const config: RangeConfig = {
|
|
rangeStrategy: 'auto',
|
|
depType: 'devDependencies',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('replace');
|
|
});
|
|
|
|
it('replaces app dependencies', () => {
|
|
const config: RangeConfig = {
|
|
rangeStrategy: 'auto',
|
|
depType: 'dependencies',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('replace');
|
|
});
|
|
|
|
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 replace', () => {
|
|
const config: RangeConfig = {
|
|
rangeStrategy: 'auto',
|
|
depType: 'dependencies',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('replace');
|
|
});
|
|
});
|