mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-31 01:37:24 +00:00
98b7710df5
updateLockedDependency() only searched the packages section of composer.lock, so updates to packages-dev dependencies were never recognized as already committed to the branch. Every Renovate run then fell back to a full artifact update and rebuilt the branch from a clean base, force-pushing grouped composer PRs containing dev dependencies whenever the base branch had moved - even with identical content.
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { Fixtures } from '~test/fixtures.ts';
|
|
import type { UpdateLockedConfig } from '../types.ts';
|
|
import { updateLockedDependency } from './index.ts';
|
|
|
|
const lockFile = 'compose.lock';
|
|
|
|
const lockFileContent = Fixtures.get('composer5.lock');
|
|
|
|
describe('modules/manager/composer/update-locked', () => {
|
|
it('detects already updated', () => {
|
|
const config: UpdateLockedConfig = {
|
|
packageFile: 'composer.json',
|
|
lockFile,
|
|
lockFileContent,
|
|
depName: 'awesome/git',
|
|
newVersion: '1.2.0',
|
|
currentVersion: '0.9.0',
|
|
};
|
|
expect(updateLockedDependency(config).status).toBe('already-updated');
|
|
});
|
|
|
|
it('detects already updated dev dependency', () => {
|
|
const config: UpdateLockedConfig = {
|
|
packageFile: 'composer.json',
|
|
lockFile,
|
|
lockFileContent,
|
|
depName: 'awesome/dev-tool',
|
|
newVersion: '2.1.0',
|
|
currentVersion: '2.0.0',
|
|
};
|
|
expect(updateLockedDependency(config).status).toBe('already-updated');
|
|
});
|
|
|
|
it('returns unsupported', () => {
|
|
const config: UpdateLockedConfig = {
|
|
packageFile: 'composer.json',
|
|
lockFile,
|
|
lockFileContent,
|
|
depName: 'awesome/git',
|
|
newVersion: '1.0.0',
|
|
currentVersion: '0.9.0',
|
|
};
|
|
expect(updateLockedDependency(config).status).toBe('unsupported');
|
|
});
|
|
});
|