From 73689a85501808ab90c906a5a1e19a587ffeecd0 Mon Sep 17 00:00:00 2001 From: Stephane Rufer Date: Thu, 18 May 2017 14:00:03 -0700 Subject: [PATCH] check.js: Ignore dedup warnings for bundled dependencies Any package with bundledDependencies will be added to a hash of bundled deps, which are used to check against when printing dedup warnings. This is because bundled dependencies could result in duplications which we would otherwise detect as false positives. Fixes #3299 --- __tests__/commands/check.js | 9 +++++++++ .../check/bundled-dep-check/nyc-10.3.2.tgz | Bin 0 -> 6814 bytes .../check/bundled-dep-check/package.json | 9 +++++++++ .../fixtures/check/bundled-dep-check/yarn.lock | 13 +++++++++++++ src/cli/commands/check.js | 14 ++++++++++---- 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 __tests__/fixtures/check/bundled-dep-check/nyc-10.3.2.tgz create mode 100644 __tests__/fixtures/check/bundled-dep-check/package.json create mode 100644 __tests__/fixtures/check/bundled-dep-check/yarn.lock diff --git a/__tests__/commands/check.js b/__tests__/commands/check.js index 643b4db402..66cf41f54c 100644 --- a/__tests__/commands/check.js +++ b/__tests__/commands/check.js @@ -313,3 +313,12 @@ test.concurrent('--integrity --check-files should not die on broken symlinks', a }, ); }); + +test.concurrent('should ignore bundled dependencies', +async (): Promise => { + await runInstall({}, path.join('..', 'check', 'bundled-dep-check'), + async (config, reporter, install, getStdout): Promise => { + await checkCmd.run(config, reporter, {}, []); + expect(getStdout().indexOf('warning')).toEqual(-1); + }); +}); diff --git a/__tests__/fixtures/check/bundled-dep-check/nyc-10.3.2.tgz b/__tests__/fixtures/check/bundled-dep-check/nyc-10.3.2.tgz new file mode 100644 index 0000000000000000000000000000000000000000..a8653ea178ee7cb95bf8e0d0320ea67636f8d6aa GIT binary patch literal 6814 zcmV;P8e!!hiwFP!000006YV_ha@$6d`K_lIJGTL7lMqQ+lC7+FlQ>Dmd&y?Y&feCQ zq@_S$NJ0VuEC!UUb##@wXUNZeggn(g$#wU910d~uT(0iUsKgXzx_f$hdV0Eh22;h! zRlMZ;mHdq^MO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