()
| 208 | |
| 209 | describe('retryStrategy', () => { |
| 210 | function captureRetryStrategy(): (times: number) => number { |
| 211 | let capturedConfig: Record<string, unknown> = {} |
| 212 | MockRedisConstructor.mockImplementation( |
| 213 | class { |
| 214 | constructor(_url: string, config: Record<string, unknown>) { |
| 215 | capturedConfig = config |
| 216 | Object.assign(this, { ping: vi.fn(), on: vi.fn() }) |
| 217 | } |
| 218 | } |
| 219 | ) |
| 220 | |
| 221 | getRedisClient() |
| 222 | |
| 223 | return capturedConfig.retryStrategy as (times: number) => number |
| 224 | } |
| 225 | |
| 226 | it('should use exponential backoff with jitter', () => { |
| 227 | const retryStrategy = captureRetryStrategy() |
no test coverage detected