diff options
-rw-r--r-- | lib/ls.js | 2 | ||||
-rw-r--r-- | tap-snapshots/test-lib-ls.js-TAP.test.js | 1 | ||||
-rw-r--r-- | test/lib/ls.js | 13 |
3 files changed, 13 insertions, 3 deletions
@@ -428,7 +428,7 @@ const ls = async (args) => { !(node instanceof Arborist.Node) || (node[_depth] > depthToPrint) return (shouldSkipChildren) ? [] - : [...node.edgesOut.values()] + : [...(node.target || node).edgesOut.values()] .filter(filterByEdgesTypes({ dev, development, diff --git a/tap-snapshots/test-lib-ls.js-TAP.test.js b/tap-snapshots/test-lib-ls.js-TAP.test.js index 6dc4d9a71..cded6fa5a 100644 --- a/tap-snapshots/test-lib-ls.js-TAP.test.js +++ b/tap-snapshots/test-lib-ls.js-TAP.test.js @@ -453,6 +453,7 @@ filter-by-child-of-missing-dep@1.0.0 {CWD}/ls-ls-loading-a-tree-containing-works exports[`test/lib/ls.js TAP ls loading a tree containing workspaces > should list workspaces properly 1`] = ` filter-by-child-of-missing-dep@1.0.0 {CWD}/ls-ls-loading-a-tree-containing-workspaces +-- a@1.0.0 -> {CWD}/ls-ls-loading-a-tree-containing-workspaces/a +| \`-- c@1.0.0 \`-- b@1.0.0 -> {CWD}/ls-ls-loading-a-tree-containing-workspaces/b ` diff --git a/test/lib/ls.js b/test/lib/ls.js index f968f406f..db4ba81ee 100644 --- a/test/lib/ls.js +++ b/test/lib/ls.js @@ -1396,12 +1396,21 @@ t.test('ls', (t) => { }), node_modules: { a: t.fixture('symlink', '../a'), - b: t.fixture('symlink', '../b') + b: t.fixture('symlink', '../b'), + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + } }, a: { 'package.json': JSON.stringify({ name: 'a', - version: '1.0.0' + version: '1.0.0', + dependencies: { + c: '^1.0.0' + } }) }, b: { |