mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 00:56: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
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { GlobalConfig } from '../../../config/global';
|
|
import { extractGradleVersion, getJavaContraint } from './utils';
|
|
|
|
describe('modules/manager/gradle-wrapper/util', () => {
|
|
describe('getJavaContraint()', () => {
|
|
it('return null for global mode', () => {
|
|
expect(getJavaContraint(undefined)).toBeNull();
|
|
});
|
|
|
|
it('return ^11.0.0 for docker mode and undefined gradle', () => {
|
|
GlobalConfig.set({ binarySource: 'docker' });
|
|
expect(getJavaContraint(undefined)).toBe('^11.0.0');
|
|
});
|
|
|
|
it('return ^8.0.0 for docker gradle < 5', () => {
|
|
GlobalConfig.set({ binarySource: 'docker' });
|
|
expect(getJavaContraint('4.9')).toBe('^8.0.0');
|
|
});
|
|
|
|
it('return ^11.0.0 for docker gradle >=5 && <7', () => {
|
|
GlobalConfig.set({ binarySource: 'docker' });
|
|
expect(getJavaContraint('6.0')).toBe('^11.0.0');
|
|
});
|
|
|
|
it('return ^16.0.0 for docker gradle >= 7', () => {
|
|
GlobalConfig.set({ binarySource: 'docker' });
|
|
expect(getJavaContraint('7.0.1')).toBe('^16.0.0');
|
|
});
|
|
});
|
|
|
|
describe('extractGradleVersion()', () => {
|
|
it('works for undefined', () => {
|
|
expect(extractGradleVersion(undefined)).toBeNull();
|
|
});
|
|
});
|
|
});
|