diff --git a/lib/help-search.js b/lib/help-search.js index c1814b4e53fc3..d60ef5b4ba89f 100644 --- a/lib/help-search.js +++ b/lib/help-search.js @@ -132,11 +132,15 @@ const searchFiles = async (args, data, files) => { // sort results by number of results found, then by number of hits // then by number of matching lines + + // coverage is ignored here because the contents of results are + // nondeterministic due to either glob or readFiles or Object.entries return results.sort((a, b) => a.found.length > b.found.length ? -1 : a.found.length < b.found.length ? 1 : a.totalHits > b.totalHits ? -1 : a.totalHits < b.totalHits ? 1 + /* istanbul ignore next */ : a.lines.length > b.lines.length ? -1 : a.lines.length < b.lines.length ? 1 : 0).slice(0, 10)