test(shrinkwrap): deps of deps should satisfy package.json semver

Rel #634
This commit is contained in:
zkochan
2017-03-03 20:49:41 +02:00
parent 0ad4f92a93
commit f3b0b6f4c1

View File

@@ -57,3 +57,18 @@ test('fail when shasum from shrinkwrap does not match with the actual one', asyn
t.ok(err.message.indexOf('Incorrect shasum') !== -1, 'failed with expected error')
}
})
test("shrinkwrap doesn't lock subdependencies that don't satisfy the new specs", async t => {
const project = prepare(t)
// dependends on react-onclickoutside@5.9.0
await installPkgs(['react-datetime@2.8.8'], testDefaults({save: true}))
// dependends on react-onclickoutside@0.3.4
await installPkgs(['react-datetime@1.3.0'], testDefaults({save: true}))
t.equal(
project.requireModule('.localhost+4873/react-datetime/1.3.0/node_modules/react-onclickoutside/package.json').version,
'0.3.4',
'react-datetime@1.3.0 has react-onclickoutside@0.3.4 in its node_modules')
})