@reduxjs/toolkit
Version:
The official, opinionated, batteries-included toolset for efficient Redux development
20 lines (15 loc) • 665 B
text/typescript
import type { RetryOptions } from '@internal/query/retry'
describe('type tests', () => {
test('RetryOptions only accepts one of maxRetries or retryCondition', () => {
// Should not complain if only `maxRetries` exists
expectTypeOf({ maxRetries: 5 }).toMatchTypeOf<RetryOptions>()
// Should not complain if only `retryCondition` exists
expectTypeOf({ retryCondition: () => false }).toMatchTypeOf<RetryOptions>()
// Should complain if both `maxRetries` and `retryCondition` exist at once
expectTypeOf({
maxRetries: 5,
retryCondition: () => false,
}).not.toMatchTypeOf<RetryOptions>()
})
})
export {}