
Install the required development tools for the course, including node, Typekit, Postman, Visual Studio Code, MongoDB (community server) and MongoDB Compass, and Postgres, to set up the restaurant API project.
Install the MongoDB community server on macOS with Homebrew, after installing Xcode command line tools. Run brew install mongodb@7.0 and verify with the mongo shell show dbs.
install the mongodb community server, mongodb shell, and mongodb compass on windows, configure path, start the server, and connect to view databases.
Explore unit testing with Nest.js and Jest by testing a restaurant API, creating a testing module, and using mocks to verify the find all function returns an array of guests.
Create and run the first unit test for the restaurant service in nest.js using a testing module, beforeEach, describe, and providers to verify the service is defined.
Learn how to test the findAll function of a restaurants service in Nest.js with Jest by mocking the database calls, spying on model.find, and validating the returned array of restaurants.
Demonstrate unit testing of the restaurants service create function in nest.js with jest, by supplying restaurant and user data, mocking restaurant location and provider dependencies, and validating the created restaurant.
Explains how to unit test RestaurantsService.findById in Nest.js with Jest, covering success by id, invalid id yielding a bad request exception, and non-existent id triggering a not found exception.
Learn how to test the restaurants service update by id in Nest.js with Jest, including preparing an updated restaurant, spying on the model, and asserting the updated name.
Test the deleteById function in RestaurantsService with Nest.js and Jest, using mocks and asserting a true deletion. The video also previews upcoming tests for uploading images to an S3 bucket.
Test the restaurants service uploadImages by mocking the upload, simulating S3 uploads, and asserting the updated restaurant contains the new image data.
Explore unit testing of the RestaurantsService deleteImages method in Nest.js using Jest, including mocking AWS S3 interactions, spying on APIs, and validating a true result.
Set up a nest.js testing module for the restaurant controller, inject a mock restaurant service, and verify the controller is defined for the first unit test.
Demonstrates unit testing of the restaurant controller's getAllRestaurants in Nest.js with Jest by mocking the service to return an array of restaurants.
Master unit and end-to-end testing in Nest.js with Jest by validating the create restaurant workflow in the controller. Create mocks, verify service calls, and confirm a restaurant is created.
Master unit and e2e testing in Nest.js with Jest by validating the restaurant controller’s getRestaurantById flow, using service mocks and a mock restaurant result.
Perform unit tests for the updated restaurant function in Nest.js using Jest, validating update by ID, service and controller interactions, and handling forbidden updates with proper exceptions.
Explore unit and e2e testing of Nest.js with Jest for the restaurant controller deleteRestaurant, covering delete by id, delete images checks, and exception scenarios using mock restaurant service.
Test the restaurant controller's upload files by mocking the image upload service, ensuring the updated restaurant includes the uploaded images and that both files are tested.
Test an auth service in a Nest.js app with Jest, setting up the testing module, configuring the JWT module, and scaffolding sign up and log in unit tests.
Illustrates unit testing of the Nest.js auth service sign up function with Jest, covering hash, user creation, and JWT token assignment, including handling duplicate emails.
Test the Nest.js auth service login with Jest, covering successful login returns a JWT token and failure cases for invalid email or password with unauthorized errors.
Learn to unit test an auth controller in Nest.js using Jest, by creating a testing module, configuring providers, and validating controller definitions before testing sign up and login functions.
Learn how to unit test the auth controller's signUp flow by mocking dependencies, asserting the signUp service is called, and verifying the returned JWT token.
Learn how to test the AuthController login in a Nest.js app using Jest, verify service calls and JWT token return, and outline future tests for the JWT strategy.
Unit test a JwtStrategy in Nest.js with Jest by configuring a test module and mocking the user model. Validate a payload returns the user; invalid payload throws unauthorized exception.
Explore end-to-end testing in nest.js with jest, compare it to unit testing, and validate a production-ready API by sending real requests and verifying responses.
Test authentication routes with Nest.js and Jest using end-to-end tests that isolate a dedicated testing database, cover sign up and login flows, and verify tokens are returned.
Learn to test a protected Nest.js restaurant post with Jest, using a login JWT to obtain a token and verify created restaurant data.
Test restaurant get routes with e2e testing in Nest.js using Jest; verify get all and get by id endpoints, check status 200 and response body, ensure database cleanup after tests.
Learn to unit and end-to-end test Nest.js rest endpoints using jest by validating restaurant update via put and deletion via delete, including token-authenticated routes and response checks.
If you want to learn Unit Testing and End-to-End (e2e) Testing in NestJS using Jest, then this course is for you.
NestJS is one of the most powerful frameworks for building scalable backend applications. But writing code is not enough — proper testing ensures your application is reliable and production-ready.
In this course, you will learn how to write unit tests for controllers, services, and modules and how to perform end-to-end testing of APIs using Jest. We will use TypeScript and NestJS’s built-in Testing Module to mock dependencies, test business logic, and verify complete API behavior.
By the end of this course, you will be able to confidently write clean, maintainable, and production-ready tests for your NestJS applications.
=== Super Friendly Support ===
If you ever get stuck, I'm here to help. I try to respond as quickly as possible so you don’t stay blocked while learning.
What we will cover
Understanding testing in NestJS
Setting up testing with Jest
Unit testing controllers and services
Mocking dependencies and providers
Using the NestJS Testing Module
Writing End-to-End (e2e) tests for APIs
Best practices for maintainable tests
If you want to master testing in NestJS, enroll now and I will see you in the course.