Skip to content

Commit efb1ebd

Browse files
committed
Fix RetryOptions type test by flipping order
1 parent 8bb90a1 commit efb1ebd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/toolkit/src/query/tests/retry.test-d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ import type { RetryOptions } from '@internal/query/retry'
22

33
describe('type tests', () => {
44
test('RetryOptions only accepts one of maxRetries or retryCondition', () => {
5+
// Should not complain if only `maxRetries` exists
6+
expectTypeOf({ maxRetries: 5 }).toMatchTypeOf<RetryOptions>()
7+
8+
// Should not complain if only `retryCondition` exists
9+
expectTypeOf({ retryCondition: () => false }).toMatchTypeOf<RetryOptions>()
10+
511
// Should complain if both `maxRetries` and `retryCondition` exist at once
6-
expectTypeOf<RetryOptions>().not.toMatchTypeOf({
12+
expectTypeOf({
713
maxRetries: 5,
814
retryCondition: () => false,
9-
})
15+
}).not.toMatchTypeOf<RetryOptions>()
1016
})
1117
})
1218

0 commit comments

Comments
 (0)