Questions tagged [nestjs-testing]
34 questions
0
votes
2 answers
How to Test Timeout Interceptor in Nestjs Using Jest
I can't find any explanation on how to test interceptors in NestJS.
Please help me to test the Interceptor using jest?
import { Injectable, NestInterceptor, ExecutionContext, CallHandler, RequestTimeoutException } from "@nestjs/common";
import {…

Gowtham Raj
- 103
- 2
- 13
0
votes
1 answer
Unable to insert data through EntityRepository.create or EntityRepository.persist #MikroOrm #NestJS
:)
I am trying to test my Entity operations using the code in the file.
I am creating a userRepository object as follows:
image
When I console.log find{} from the repository, it fetches the previously stored records:
image
I create a dummy object…

Shivam Pathak
- 73
- 5
0
votes
0 answers
NestJs Testing - Is REPOSITORY part of the relevant providers/imports within module
I am trying to write the unit test cases for the mono-repo based application using nestjs.
I'm facing the following error
Nest cannot export a provider/module that is not a part of the currently processed module (CacheManagerModule). Please verify…

Gowtham Raj
- 103
- 2
- 13
0
votes
1 answer
NestJS tests failing: Cannot set property 'email' of undefined
I'm seeing a weird error in my test file for a NestJS application. I can't seem to figure out, what went wrong: I have a test file for a TypeORM repository:
describe('UserRepository', () => {
let userRepository;
beforeEach(async () => {
…

Xen_mar
- 8,330
- 11
- 51
- 74