File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/toolkit/src/query/tests Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,17 @@ import type { RetryOptions } from '@internal/query/retry'
2
2
3
3
describe ( 'type tests' , ( ) => {
4
4
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
+
5
11
// Should complain if both `maxRetries` and `retryCondition` exist at once
6
- expectTypeOf < RetryOptions > ( ) . not . toMatchTypeOf ( {
12
+ expectTypeOf ( {
7
13
maxRetries : 5 ,
8
14
retryCondition : ( ) => false ,
9
- } )
15
+ } ) . not . toMatchTypeOf < RetryOptions > ( )
10
16
} )
11
17
} )
12
18
You can’t perform that action at this time.
0 commit comments