Skip to content

Commit 7898f23

Browse files
committed
ignore the sort in help-search more broadly
It turns out that the other stuff in those objects might also be in random order, so this is still triggering CI coverage failures, albeit more rarely than it used to. Just ignore the whole sort function. It's fine, we implicitly assert on the sortedness in the test, so we know that it is doing its job. PR-URL: #2574 Credit: @isaacs Close: #2574 Reviewed-by: @nlf
1 parent dd05ba0 commit 7898f23

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/help-search.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,11 @@ const searchFiles = async (args, data, files) => {
135135

136136
// coverage is ignored here because the contents of results are
137137
// nondeterministic due to either glob or readFiles or Object.entries
138-
return results.sort((a, b) =>
138+
return results.sort(/* istanbul ignore next */ (a, b) =>
139139
a.found.length > b.found.length ? -1
140140
: a.found.length < b.found.length ? 1
141141
: a.totalHits > b.totalHits ? -1
142142
: a.totalHits < b.totalHits ? 1
143-
/* istanbul ignore next */
144143
: a.lines.length > b.lines.length ? -1
145144
: a.lines.length < b.lines.length ? 1
146145
: 0).slice(0, 10)

0 commit comments

Comments
 (0)