Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(arborist): fix superfluous arguments #4464

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion workspaces/arborist/test/audit-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs a test on a different locale?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something I introduced here, though. Feel free to push any tests.

effects: (vuln.effects || []).sort((a, b) => a.localeCompare(b, 'en')),
},
])
Expand Down
2 changes: 1 addition & 1 deletion workspaces/arborist/test/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
4 changes: 2 additions & 2 deletions workspaces/arborist/test/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' } },
Expand All @@ -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' } },
Expand Down