From f18cd14bf9cd882d4cf3ae29ed786bf00ce7c41e Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Thu, 28 Jul 2016 15:43:52 +0200 Subject: [PATCH] Type check RetryStrategyOptions props explicitly --- redis/redis-tests.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/redis/redis-tests.ts b/redis/redis-tests.ts index c25107f64e..aadaa40f48 100644 --- a/redis/redis-tests.ts +++ b/redis/redis-tests.ts @@ -30,6 +30,12 @@ client = redis.createClient(num, str, options); // Test the `retry_strategy` property // ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- function retryStrategyNumber(options: redis.RetryStrategyOptions): number { + // Ensure that the properties of RetryStrategyOptions are resilient to breaking change. + // If the properties of the interface changes, the variables below will also need to be adapted. + var error: Error = options.error; + var total_retry_time: number = options.total_retry_time; + var times_connected: number = options.times_connected; + var attempt: number = options.attempt; return 5000; } function retryStrategyError(options: redis.RetryStrategyOptions): Error {