diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index 8aecd513dd35ef406c1581331b3666bfa21ec397..93413f8a63acdba6ce0099fbb2727f22fcf1a6e9 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -347,6 +347,15 @@ describe(getName(__filename), () => { nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(0); }); + it('ignores minor ranged versions when locked', async () => { + config.rangeStrategy = 'replace'; + config.currentValue = '^1.0.0'; + config.lockedVersion = '1.1.0'; + config.depName = 'q'; + config.datasource = datasourceNpmId; + nock('https://registry.npmjs.org').get('/q').reply(200, qJson); + expect((await lookup.lookupUpdates(config)).updates).toHaveLength(0); + }); it('upgrades tilde ranges', async () => { config.rangeStrategy = 'pin'; config.currentValue = '~1.3.0'; diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 84b21acdc1e0980f5a6c7e622e60c580cc4ccbdb..07251b2d7e4a43ffca83deb0155edff948df741a 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -138,7 +138,6 @@ export async function lookupUpdates( .filter((release) => !release.isDeprecated) .map((release) => release.version); const currentVersion = - lockedVersion || getCurrentVersion( config, versioning, @@ -290,6 +289,7 @@ export async function lookupUpdates( // Record if the dep is fixed to a version if (lockedVersion) { + res.currentVersion = lockedVersion; res.fixedVersion = lockedVersion; } else if (currentValue && versioning.isSingleVersion(currentValue)) { res.fixedVersion = currentValue.replace(/^=+/, '');