Skip to content

Commit b6b9d1a

Browse files
authored
test(query-persist-client-core/retryStrategies): add test for 'removeOldestQuery' returning undefined when there are no queries (#10868)
1 parent 64b54a0 commit b6b9d1a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/query-persist-client-core/src/__tests__/retryStrategies.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,16 @@ describe('removeOldestQuery', () => {
7373
['b'],
7474
])
7575
})
76+
77+
it('should return undefined when there are no queries to remove', () => {
78+
const persistedClient = createPersistedClient([])
79+
80+
const result = removeOldestQuery({
81+
persistedClient,
82+
error: new Error('full'),
83+
errorCount: 1,
84+
})
85+
86+
expect(result).toBeUndefined()
87+
})
7688
})

0 commit comments

Comments
 (0)