Skip to content

Commit

Permalink
fix: fetchPartialPackument fallback is not done right
Browse files Browse the repository at this point in the history
  • Loading branch information
rbnayax committed Aug 7, 2024
1 parent ed0767b commit 6a7de59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 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
3 changes: 2 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,7 @@ 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 6a7de59

Please sign in to comment.