Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2020-07-29 03:18:20 +0300
committerisaacs <i@izs.me>2020-07-30 00:54:08 +0300
commit6ef53ee73a2a0ed26f8c1507018d201a7bd36d1e (patch)
treee588f7f24af2511525f70783e821e151df8a9e19 /tap-snapshots
parent83f4a0914de25e9ea03191d8dc6ffc8dbb73bb3a (diff)
fix: npm ls duplicated items
When having nodes that are children of extraneous nodes, items were getting printed twice using `npm ls`. This fixes it by keeping track of seen nodes while iterating in a same children level and effectively avoiding printing a same item twice. fix: #1573 PR-URL: https://github.com/npm/cli/pull/1576 Credit: @ruyadorno Close: #1576 Reviewed-by: @isaacs
Diffstat (limited to 'tap-snapshots')
-rw-r--r--tap-snapshots/test-lib-ls.js-TAP.test.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/tap-snapshots/test-lib-ls.js-TAP.test.js b/tap-snapshots/test-lib-ls.js-TAP.test.js
index 1363eec70..6f0c0beff 100644
--- a/tap-snapshots/test-lib-ls.js-TAP.test.js
+++ b/tap-snapshots/test-lib-ls.js-TAP.test.js
@@ -373,6 +373,16 @@ test-npm-ls@1.0.0 {CWD}/ls-ls-extraneous-deps
`
+exports[`test/lib/ls.js TAP ls filtering by child of missing dep > should print tree and not duplicate child of missing items 1`] = `
+filter-by-child-of-missing-dep@1.0.0 {CWD}/ls-ls-filtering-by-child-of-missing-dep
++-- b@1.0.0 extraneous
+| \`-- c@1.0.0 deduped
++-- c@1.0.0 extraneous
+\`-- d@1.0.0 extraneous
+ \`-- c@2.0.0 extraneous
+
+`
+
exports[`test/lib/ls.js TAP ls from and resolved properties > should not be printed in tree output 1`] = `
test-npm-ls@1.0.0 {CWD}/ls-ls-from-and-resolved-properties
\`-- simple-output@2.1.1