Skip to content

Commit

Permalink
fix: fetchPartialPackument fallback is not done right (#1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbnayax authored Aug 7, 2024
1 parent cf94481 commit 71423af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/package-managers/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const fetchPartialPackument = async (
}

// possible that corgis are not supported by this registry
return fetchPartialPackument(name, fields, tag, { opts, fullMetadata: true })
return fetchPartialPackument(name, fields, tag, { ...opts, fullMetadata: true }, version)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/getEnginesNodeFromRegistry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('getEnginesNodeFromRegistry', function () {

it('single package empty', async () => {
await chalkInit()
const data = await getEnginesNodeFromRegistry({ 'ncu-test-return-version': '1.0' }, {})
const data = await getEnginesNodeFromRegistry({ 'ncu-test-return-version': '1.0.0' }, {})
data.should.deep.equal({ 'ncu-test-return-version': undefined })
})

Expand Down
5 changes: 4 additions & 1 deletion test/package-managers/npm/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ describe('npm', function () {

it('getEngines', async () => {
await npm.getEngines('del', '2.0.0').should.eventually.deep.equal({ node: '>=0.10.0' })
await npm.getEngines('ncu-test-return-version', '1.0').should.eventually.deep.equal({})
await npm.getEngines('ncu-test-return-version', '1.0.0').should.eventually.deep.equal({})
await npm
.getEngines('ncu-test-return-version', '1.0')
.should.eventually.be.rejectedWith('404 Not Found - GET https://registry.npmjs.org/ncu-test-return-version/1.0')
})
})

0 comments on commit 71423af

Please sign in to comment.