skip to Main Content

redis mock for testing in nestjs

I am writing test cases in my email-service.spec.ts file my email-service file @Injectable() export class EmailSubscriptionService { private nodeTokenCache; private result; constructor(@InjectRepository(ConsumerEmailSubscriptions) private readonly emailSubscriptions: Repository<ConsumerEmailSubscriptions>, @InjectRepository(EmailSubscriptions) private readonly emailSubscriptionLegacy: Repository<EmailSubscriptions>, @InjectRedisClient('0') private redisClient: Redis.Redis, private readonly config: ConfigService, private…

VIEW QUESTION

Store a value in redis store using Nestjs

I have a simple nestjs application, where I have set up a CacheModule using Redis store as follows: import * as redisStore from 'cache-manager-redis-store'; CacheModule.register({ store: redisStore, host: 'redis', port: 6379, }), I would like to use it to store…

VIEW QUESTION
Back To Top
Search