I'm trying to execute useMocker on the following piece of code:
const module = await Test.createTestingModule({
providers: [
RatingService,
UserService,
RentService,
{ provide: getRepositoryToken(RatingORM), useValue: repositoryMockFactory(ratingStub()) },
],
}).useMocker((token) => {
switch(token) {
case UserService: return UserService;
case RentService: return RentService;
}
}).compile();
but I keep getting the error "Property 'useMocker' does not exist on type 'TestingModuleBuilder'"
Anyone knows why is that?
make sure you're using the right version of @nestjs/testing
. Upgrade it to the latest or something