0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-11 13:48:55 +00:00
renovatebot_renovate/lib/modules/manager/mix/range.spec.ts
2025-01-09 14:54:48 +00:00

47 lines
1.2 KiB
TypeScript

import type { RangeConfig } from '../types';
import { getRangeStrategy } from '.';
describe('modules/manager/mix/range', () => {
it('returns same if not auto', () => {
const config: RangeConfig = { rangeStrategy: 'pin' };
expect(getRangeStrategy(config)).toBe('pin');
config.rangeStrategy = 'widen';
expect(getRangeStrategy(config)).toBe('widen');
});
it('widens complex bump', () => {
const config: RangeConfig = {
rangeStrategy: 'bump',
depType: 'prod',
currentValue: '>= 1.6.0 and < 2.0.0',
};
expect(getRangeStrategy(config)).toBe('widen');
});
it('bumps non-complex bump', () => {
const config: RangeConfig = {
rangeStrategy: 'bump',
depType: 'prod',
currentValue: '~>1.0.0',
};
expect(getRangeStrategy(config)).toBe('bump');
});
it('widens complex auto', () => {
const config: RangeConfig = {
rangeStrategy: 'auto',
depType: 'prod',
currentValue: '<1.7.0 or ~>1.7.1',
};
expect(getRangeStrategy(config)).toBe('widen');
});
it('defaults to update-lockfile', () => {
const config: RangeConfig = {
rangeStrategy: 'auto',
depType: 'prod',
};
expect(getRangeStrategy(config)).toBe('update-lockfile');
});
});