Files
renovate/lib/modules/manager/composer/update-locked.spec.ts
Bram Rongen 98b7710df5 fix(composer): detect already-updated lockfile updates for dev dependencies (#44805)
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.
2026-07-30 12:57:30 +00:00

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');
});
});