diff --git a/lib/workers/repository/process/lookup/filter.js b/lib/workers/repository/process/lookup/filter.js index 104ea75e5b82062b9f5cc7c2c3bb0a3215c1c52f..b28a2e4687bf3f47203b6047cf6081076cb0924c 100644 --- a/lib/workers/repository/process/lookup/filter.js +++ b/lib/workers/repository/process/lookup/filter.js @@ -64,7 +64,7 @@ function filterVersions( } // Return all versions if we aren't ignore unstable. Also ignore latest - if (ignoreUnstable === false) { + if (config.followTag || ignoreUnstable === false) { return filteredVersions; } diff --git a/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap b/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap index fc379d649bf9040ee8caafd34361bd6ff7431f24..a81bb2dc55be4e25ae8ca2390ecb3f0a60b0e617 100644 --- a/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap +++ b/test/workers/repository/process/lookup/__snapshots__/index.spec.js.snap @@ -782,6 +782,22 @@ Array [ ] `; +exports[`manager/npm/lookup .lookupUpdates() should jump unstable versions if followTag 1`] = ` +Array [ + Object { + "canBeUnpublished": false, + "fromVersion": "3.0.0-insiders.20180706", + "isSingleVersion": true, + "newMajor": 3, + "newMinor": 0, + "newValue": "3.0.1-insiders.20180726", + "releaseTimestamp": "2018-07-26T18:20:51.679Z", + "toVersion": "3.0.1-insiders.20180726", + "updateType": "minor", + }, +] +`; + exports[`manager/npm/lookup .lookupUpdates() should not jump unstable versions 1`] = ` Array [ Object { diff --git a/test/workers/repository/process/lookup/index.spec.js b/test/workers/repository/process/lookup/index.spec.js index 4d4025026a7b7396585eef9cde8c49c7a7d8aa3f..3a88eab72e1a3cee73ca7633d6554ff8f4a1840b 100644 --- a/test/workers/repository/process/lookup/index.spec.js +++ b/test/workers/repository/process/lookup/index.spec.js @@ -720,6 +720,19 @@ describe('manager/npm/lookup', () => { expect(res.updates).toHaveLength(1); expect(res.updates[0].newValue).toEqual('3.0.1-insiders.20180726'); }); + it('should jump unstable versions if followTag', async () => { + config.currentValue = '3.0.0-insiders.20180706'; + config.depName = 'typescript'; + config.purl = 'pkg:npm/typescript'; + config.followTag = 'insiders'; + nock('https://registry.npmjs.org') + .get('/typescript') + .reply(200, typescriptJson); + const res = await lookup.lookupUpdates(config); + expect(res.updates).toMatchSnapshot(); + expect(res.updates).toHaveLength(1); + expect(res.updates[0].newValue).toEqual('3.0.1-insiders.20180726'); + }); it('should update nothing if current version is dist-tag', async () => { config.currentValue = '3.0.1-insiders.20180726'; config.depName = 'typescript';