NestJS · Junior · Question 49 of 75

How do you replace a real service with a mock in a Nest test?

Explanation

You can also register { provide: UsersService, useValue: mock } directly in providers.

Further reading

Problem with a question

NestJS · Junior · question 49

Test yourself

Take the NestJS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz