skip to Main Content

How to mock Jest Redis in Nestjs

I'm working on NestJs application and wrote unit test for my authenticateUser function in user.service.ts.It's has pass in my local machine.but when I deployed it in to server and run unit test, i got an error Redis connection to 127.0.0.1:6379…

VIEW QUESTION

not able to connect to redis in nodejs

First thing first, the details: node version: v16 Using redislabs cloud (v6.2.3) npm package redis version 4.0.3 Here's the code... const redis = require("redis"); require("dotenv").config(); const client = redis.createClient({ host: process.env.REDIS_URI, port: process.env.REDIS_PORT, password: process.env.REDIS_PASSWORD }); client.on("connect", () => {…

VIEW QUESTION
Back To Top
Search