From f3b0b6f4c131cf4e9cff67ca89aba5ba0cbd545e Mon Sep 17 00:00:00 2001 From: zkochan Date: Fri, 3 Mar 2017 20:49:41 +0200 Subject: [PATCH] test(shrinkwrap): deps of deps should satisfy package.json semver Rel #634 --- test/shrinkwrap.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/shrinkwrap.ts b/test/shrinkwrap.ts index 6eb711922e..de67285b8b 100644 --- a/test/shrinkwrap.ts +++ b/test/shrinkwrap.ts @@ -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') +})