Skip to content
Snippets Groups Projects
Commit 0f1ccb77 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

test: replace coverage fix todo

parent 8b97c924
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,28 @@ describe(getName(__filename), () => {
)
).toEqual('4.9.1');
});
it('finds when a greater version is needed', async () => {
httpMock
.scope('https://registry.npmjs.org')
.get('/qs')
.reply(200, {
name: 'qs',
repository: {},
versions: {
'0.6.6': {},
'6.0.4': {},
'6.2.0': {},
},
'dist-tags': { latest: '6.2.0' },
});
httpMock
.scope('https://registry.npmjs.org')
.get('/express')
.reply(200, expressJson);
expect(
await findFirstParentVersion('express', '4.0.0', 'qs', '6.0.4')
).toEqual('4.14.0');
});
it('finds when a range matches greater versions', async () => {
httpMock
.scope('https://registry.npmjs.org')
......
......@@ -64,7 +64,6 @@ export async function findFirstParentVersion(
return parentVersion;
}
if (semver.isVersion(constraint)) {
// istanbul ignore if: TODO FIX ME
if (semver.isGreaterThan(constraint, targetVersion)) {
// it's not the version we were after - the parent skipped to a higher version
logger.debug(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment