From 63b35578bd759cb5f3edaaef1c1122ecd0b27f48 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 23 Feb 2022 20:34:18 +0200 Subject: [PATCH] fix(arborist): fix superfluous arguments (#4464) --- workspaces/arborist/test/audit-report.js | 2 +- workspaces/arborist/test/diff.js | 2 +- workspaces/arborist/test/inventory.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/workspaces/arborist/test/audit-report.js b/workspaces/arborist/test/audit-report.js index 16ea7e13b7386..c9c610c84ed49 100644 --- a/workspaces/arborist/test/audit-report.js +++ b/workspaces/arborist/test/audit-report.js @@ -30,7 +30,7 @@ const sortReport = report => { { ...vuln, via: (vuln.via || []).sort((a, b) => - String(a.source || a).localeCompare(String(b.source || b, 'en'))), + String(a.source || a).localeCompare(String(b.source || b), 'en')), effects: (vuln.effects || []).sort((a, b) => a.localeCompare(b, 'en')), }, ]) diff --git a/workspaces/arborist/test/diff.js b/workspaces/arborist/test/diff.js index 0e943d5786ef0..78e59c293179d 100644 --- a/workspaces/arborist/test/diff.js +++ b/workspaces/arborist/test/diff.js @@ -31,7 +31,7 @@ const formatDiff = obj => removed: obj.removed.map(d => normalizePath(d.path).split(normalizedCWD).join('{CWD}')), children: [...obj.children] .map(formatDiff) - .sort((a, b) => path(a).localeCompare(path(b, 'en'))), + .sort((a, b) => path(a).localeCompare(path(b), 'en')), }) t.formatSnapshot = obj => format(formatDiff(obj), { sort: false }) diff --git a/workspaces/arborist/test/inventory.js b/workspaces/arborist/test/inventory.js index cb0a286c9edaf..31995e0caa516 100644 --- a/workspaces/arborist/test/inventory.js +++ b/workspaces/arborist/test/inventory.js @@ -21,7 +21,7 @@ t.test('basic operations', t => { i.get('y'), ], 'filter returns an iterable of all matching nodes') - t.same([...i.query('license')].sort((a, b) => String(a).localeCompare(String(b, 'en'))), + t.same([...i.query('license')].sort((a, b) => String(a).localeCompare(String(b), 'en')), ['ISC', 'MIT', undefined]) t.same([...i.query('license', 'MIT')], [ { location: 'x', name: 'x', package: { licence: 'MIT', funding: 'foo' } }, @@ -33,7 +33,7 @@ t.test('basic operations', t => { { location: 'x', name: 'x', package: { licence: 'MIT', funding: 'foo' } }, { location: 'y', name: 'x', package: { licenses: [{ type: 'ISC' }], funding: { url: 'foo' } } }, ], 'can query by name') - t.same([...i.query('funding')].sort((a, b) => String(a).localeCompare(String(b, 'en'))), + t.same([...i.query('funding')].sort((a, b) => String(a).localeCompare(String(b), 'en')), ['bar', 'foo', undefined]) t.same([...i.query('funding', 'foo')], [ { location: 'x', name: 'x', package: { licence: 'MIT', funding: 'foo' } },