Implement a unit test for UserService

Now we’ve learned the basics of unit tests and Jest. In this lesson, we’ll explore how to implement unit tests for UserService in our application using Jest.

Install the dependencies

Because we use NestJS CLI to generate the application, the Jest-related dependencies have been provisioned automatically. But when starting a new application without using the CLI generation, we need to have the following dependencies installed:

Get hands-on with 1200+ tech skills courses.