
Learn how to initialise our NodeJs Express test-driven development project with Jest
Learn how to create a simple Nodejs Express REST API in just 10 minutes!
A brieft introduction to the various REST HTTP Methods we can use inside the Nodejs Express REST API.
How to install Jest to use with Nodejs Express for test-driven development
Making our first test with Jest for Nodejs Express REST API with test-driven development
Making our first test with Jest for Nodejs Express REST API with test-driven development PASS
How to setup Jest to automatically run on file changes in our Nodejs Express app
Defining our Mongoose/MongoDB model to use with our Express REST API.
How to use jest.fn() to mock functions in our Mongoose model to verify that our Express controller has called the model correctly
Making our jest.fn() to mock functions in our Mongoose model to verify that our Express controller has called the model correctly
How to setup our Jest test environment correctly when using Mongoose inside Nodejs Express.
How to use node-mocks-http package to verify that our Nodejs Express Request and Response objects have been used correctly
How to write a Jest test with node-mocks-http Request object with the Express controller and making the test pass
How can we test if the response status code is set correctly and that the response is actually being sent back in Nodejs Express with Jest?
How to test if JSON body is being sent back correctly in our Nodejs Express REST API with Jest
Learn how to write a full CRUD REST API with Nodejs, Express and Jest using the test-driven development method!
TDD is becoming more and more of standard, and for good reasons!
With TDD, you can feel more safe and secure that any changes you make are not breaking existing functionality in your applications. Manual tests cannot be sustainable in large applications, or even medium applications. Plus, they're incredibly tedious.
Without TDD... well, you know the story. You try to add functionality while trying to touch the existing code as little as possible, because you don't want to break things unintentionally..
With TDD you won't be scared to make big refactors in your code to clean up messy code, you will know quickly if you've broken any existing functionality!
I'll show you step-by-step how to create a REST API with Express with unit tests and integration tests using the Jest test framework. There's going to be lots of opportunities for you to work on your own and do some exercises as well for optimal learning!
If you have any questions or suggestions to the course, feel free to message me anytime, I love interacting with my students!