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

nodejs+puppeteer in docker: Unexpected Identifier on import statement

I'm trying to run an application that requires puppeteer in a docker container and I get the following error when I run the docker container /usr/src/app/index.js:1 import puppeteer from 'puppeteer'; ^^^^^^^^^ SyntaxError: Unexpected identifier at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)…

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