mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 08:36:26 +00:00
dca3418bbd
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/ BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
35 lines
972 B
TypeScript
35 lines
972 B
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',
|
|
packageJsonType: 'app',
|
|
};
|
|
expect(getRangeStrategy(config)).toBe('pin');
|
|
});
|
|
it('defaults to replace', () => {
|
|
const config: RangeConfig = {
|
|
manager: 'circleci',
|
|
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');
|
|
});
|
|
});
|