Skip to content

Commit 97db5d2

Browse files
authored
test(query-core/utils): split 'isValidTimeout' rejection cases into separate 'it' blocks (#11071)
1 parent 80b833e commit 97db5d2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,23 @@ describe('core/utils', () => {
587587
expect(isValidTimeout(1_000)).toBe(true)
588588
})
589589

590-
it('should reject invalid timeout values', () => {
590+
it('should reject a negative timeout value', () => {
591591
expect(isValidTimeout(-1)).toBe(false)
592+
})
593+
594+
it('should reject NaN', () => {
592595
expect(isValidTimeout(Number.NaN)).toBe(false)
596+
})
597+
598+
it('should reject Infinity', () => {
593599
expect(isValidTimeout(Number.POSITIVE_INFINITY)).toBe(false)
600+
})
601+
602+
it('should reject a string timeout value', () => {
594603
expect(isValidTimeout('1000')).toBe(false)
604+
})
605+
606+
it('should reject undefined', () => {
595607
expect(isValidTimeout(undefined)).toBe(false)
596608
})
597609
})

0 commit comments

Comments
 (0)