Category "nestjs"

Getting 'ReferenceError: describe is not defined' error when going to start the application

I'm going to test typescript(inversify) code using jest. Below mentioned the code that use to test a controller method. describe('Test UserController',() =>{

Nest.JS/Multer: UploadedFile undefined

I've got some strange problem here: I've setup file upload just like in the nest.js tutorials. On my machine (Windows 10) everything works fine but when I deplo

NestJs redirect without response usage

Is it possible to make a redirect from a Nest controller without the usage of the @Response object? For now I know that we can only do this via direct @Response

How to validate an array of Date with class validator?

I have an array of dates in a post request body that I want to validate: { "meals": [...], "dates": [ "2022-03-06T11:00:00.000Z", "2022-

Integrate firebase notificaiton in nest js

I am trying to create fcm API using nest js which I am using in a flutter. I am new to Nest js and I have implemented the code using this. There is no error in

NestJs/swagger: Define ref schemas without DTO classes

I have an app where I define the API response schemas as plain javascript objects according to the open-api spec. Currently I am passing that to the ApiResponse

How to send response from middleware created in a Nest fastify server?

I've created a NestJs project with Fastify, and have created a middleware for it, but I can't figure out how to send a response to the client, similar to how we

Nestjs as API gateway + Moleculer as microservice

I'm very new in microservices, I was a wonder to know that is there any way to call a moleculer action from nestjs gateway?

TypeORM throws QueryFailedError Table already exists on MySQL when synchronize is true

I am using NestJS, TypeORM, and MySQL to build a web application. I am using a .env file to pass in some environment variables for connecting to my local datab

node-fetch@3 Not support in nestjs because it is ESM

I can't use the package "node-fetch@3". I just import it and my console will log the error: const node_fetch_1 = require("node-fetch"); ^ E

How to init RouterModule with variable from ConfigService?

I want to use the RouterModule.register(arrayOfRoutes), but I need to build the arrayOfRoutes with a variable from the ConfigService. What is the proper way to

How to mock S3 with jest?

I am tryng to code a test for upload. But i am not understating how to properly use jest.mock('aws-sdk') export class S3Service { private readonly s3: S3;

GraphQL Schema not updated with NestJS (code-first approach)

Pretty new to GraphQL, I am facing an issue with the latest version of NestJS where I am currently trying to add a mutation to a resolver that doesn't show in t

jest unit test mock google oauthClient in nestjs

I am currently doing unit test for the services in Nestjs using Jest, one of which is using the google Oauth service. My goal is to verify the token from google

Upload dynamic multiple files in Nest JS

I'm trying to upload files with dynamic keys, but nest.js needs to know key names. I tried this one: @UseInterceptors(FilesInterceptor('files')) async

Replace _id to id in NestJs + Typegoose

I use NestJs + Typegoose. How to replace _id to id in NestJs + Typegoose? I didn't find a clear example. I've tried something but without any results. @modelOp

Is it possible to validate that one of 2 parameters are present using class-validator?

Using class-validator along with NestJS I want to validate that a user provides either propertyA or a propertyB but they don't need to provide both. Currently,

How to send RPC replyTo - NestJs Rabbitmq

I have a simple NestJs Microservice application that is listening for messages from a Rabbitmq service. async function bootstrap() { dotenv.config(); // TO

How can I mock nest typeorm database module in end to end (e2e) tests?

all. Include details about your goal: I'm trying to mock repository in e2e test Describe expected and actual results: Request to server will not have access

nestjs Docker build error: can not find tsconfig.build.json

here is my Dockerfile: FROM node AS builder WORKDIR /app COPY package*.json ./ COPY prisma ./prisma/ COPY tsconfig.build.json ./ COPY tsconfig.json ./ RUN n