All files / redis-smq-monitor/src/lib redis.ts

100% Statements 7/7
75% Branches 3/4
100% Functions 1/1
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 1457x 57x 57x     57x   57x 66x     66x    
import { RedisClientName } from 'redis-smq-common/dist/types';
import { promisifyAll } from 'bluebird';
import { RedisClient } from 'redis-smq-common';
import { TConfig } from '../../types';
 
const RedisClientAsync = promisifyAll(RedisClient);
 
export async function createRedisInstance(config: TConfig) {
  const redis = config.redis ?? {
    client: RedisClientName.REDIS,
  };
  return RedisClientAsync.getNewInstanceAsync(redis);
}