diff --git a/test/datasource/npm/__snapshots__/index.spec.js.snap b/test/datasource/npm/__snapshots__/index.spec.js.snap index 3296e2e84aa83276471a2a6447032d773f18ced8..edea46723783ed3c870da6b6ea232400d47c0845 100644 --- a/test/datasource/npm/__snapshots__/index.spec.js.snap +++ b/test/datasource/npm/__snapshots__/index.spec.js.snap @@ -159,8 +159,6 @@ Object { } `; -exports[`api/npm should retry when 408 or 5xx 1`] = `null`; - exports[`api/npm should return deprecated 1`] = ` Object { "deprecationMessage": "On registry \`https://registry.npmjs.org/\`, the \\"latest\\" version (v0.0.2) of dependency \`foobar\` has the following deprecation notice: diff --git a/test/datasource/npm/index.spec.js b/test/datasource/npm/index.spec.js index 014e9ea18d9f1a2f6163507d274efe259d1bc72e..2e0daee0d9ce4e6bf98d6661f96aa1b9182cc48a 100644 --- a/test/datasource/npm/index.spec.js +++ b/test/datasource/npm/index.spec.js @@ -232,6 +232,13 @@ describe('api/npm', () => { const res = await npm.getPkgReleases({ lookupName: 'foobar' }); expect(res).toMatchSnapshot(); }); + it('should reject name mismatch', async () => { + nock('https://registry.npmjs.org') + .get('/different') + .reply(200, npmResponse); + const res = await npm.getPkgReleases({ lookupName: 'different' }); + expect(res).toBeNull(); + }); it('should handle no time', async () => { delete npmResponse.time['0.0.2']; nock('https://registry.npmjs.org') @@ -302,19 +309,6 @@ describe('api/npm', () => { Error('registry-failure') ); }); - it('should retry when 408 or 5xx', async () => { - nock('https://registry.npmjs.org') - .get('/foobar') - .reply(503); - nock('https://registry.npmjs.org') - .get('/foobar') - .reply(408); - nock('https://registry.npmjs.org') - .get('/foobar') - .reply(200); - const res = await npm.getPkgReleases({ lookupName: 'foobar' }); - expect(res).toMatchSnapshot(); - }); it('should throw error for others', async () => { nock('https://registry.npmjs.org') .get('/foobar')