Skip to content

Commit

Permalink
Fix test for old nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Oct 28, 2023
1 parent db7677c commit 072e392
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ function describeCasesWithOptions(title, options, cases) {
(queryString[0] === '!' ? it.skip : it)(queryString + ' // limit & sort', () => {
assert.deepEqual(
suggestQuery(queryString, data, options, true),
expected.slice().map(s =>
s && s.slice().sort((a, b) => a.type !== b.type
expected.slice().map(variants =>
// use methods.sort() since it provides stable sorting for old engines
variants && query.methods.sort(variants, (a, b) => a.type !== b.type
? 0
: a.type === 'value'
? query.buildin.cmp(JSON.parse(a.value), JSON.parse(b.value))
Expand Down

0 comments on commit 072e392

Please sign in to comment.