Skip to content

Commit 629d922

Browse files
committed
chore: convert ls test to mockNpm
1 parent 69f5ff8 commit 629d922

File tree

3 files changed

+3461
-3097
lines changed

3 files changed

+3461
-3097
lines changed

lib/commands/ls.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,9 @@ class LS extends ArboristWorkspaceCmd {
178178
e.code === 'EJSONPARSE' && e.path === resolve(path, 'package.json'))
179179

180180
this.npm.outputBuffer(
181-
json
182-
? jsonOutput({ path, problems, result, rootError, seenItems })
183-
: parseable
184-
? parseableOutput({ seenNodes, global, long })
185-
: humanOutput({ color, result, seenItems, unicode })
181+
json ? jsonOutput({ path, problems, result, rootError, seenItems }) :
182+
parseable ? parseableOutput({ seenNodes, global, long }) :
183+
humanOutput({ color, result, seenItems, unicode })
186184
)
187185

188186
// if filtering items, should exit with error code on no results
@@ -402,7 +400,7 @@ const getJsonOutputItem = (node, { global, long }) => {
402400
return augmentItemWithIncludeMetadata(node, item)
403401
}
404402

405-
const filterByEdgesTypes = ({ link, omit = [] }) => (edge) => {
403+
const filterByEdgesTypes = ({ link, omit }) => (edge) => {
406404
for (const omitType of omit) {
407405
if (edge[omitType]) {
408406
return false

0 commit comments

Comments
 (0)