Skip to content

Commit a247729

Browse files
committed
new trie produces results in insert order, remove sort cop-out from test
1 parent f102be7 commit a247729

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

packages/query-core/src/__tests__/queryCache.test.tsx

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -348,25 +348,12 @@ describe('queryCache', () => {
348348
})
349349

350350
expect(predicateCallCount).toBe(results.length)
351-
352-
const sortByHash = (a: Query | undefined, b: Query | undefined) => {
353-
if (!a && !b) return 0
354-
if (!a) return -1
355-
if (!b) return 1
356-
if (a.queryHash < b.queryHash) return -1
357-
if (a.queryHash > b.queryHash) return 1
358-
return 0
359-
}
360-
results.sort(sortByHash)
361-
362-
expect(results).toEqual(
363-
[
364-
exactMatchQuery,
365-
primitiveSuffixQuery,
366-
primitiveSuffixLength2Query,
367-
matchingObjectSuffixQuery,
368-
].sort(sortByHash),
369-
)
351+
expect(results).toEqual([
352+
exactMatchQuery,
353+
primitiveSuffixQuery,
354+
primitiveSuffixLength2Query,
355+
matchingObjectSuffixQuery,
356+
])
370357
})
371358

372359
test('should return all the queries when no filters are defined', async () => {

0 commit comments

Comments
 (0)