diff --git a/lib/node.js b/lib/node.js index 3d1771af6..bb58b244c 100644 --- a/lib/node.js +++ b/lib/node.js @@ -369,19 +369,13 @@ class Node { if (edge) why.dependents.push(edge.explain(seen)) else { - // if we have an edge from the root, just show that, and stop there - // no need to go deeper, because it doesn't provide much more value. + // ignore invalid edges, since those aren't satisfied by this thing, + // and are not keeping it held in this spot anyway. const edges = [] for (const edge of this.edgesIn) { if (!edge.valid && !edge.from.isRoot) continue - if (edge.from.isRoot) { - edges.length = 0 - edges.push(edge) - break - } - edges.push(edge) } for (const edge of edges) diff --git a/test/node.js b/test/node.js index 557dafde1..02422f6b3 100644 --- a/test/node.js +++ b/test/node.js @@ -1617,6 +1617,5 @@ t.test('explain yourself', t => { package: { noname: 'bad', noversion: 'node' }, }) - t.end() })