3.8 out of 5
3.8
31 reviews on Udemy

Unit Testing in Node.js with Jest – e2e Testing & more

Nodejs Unit Testing with Jest, e2e Testing, Test Coverage, Test Driven Development (TDD), Mocking and more
Instructor:
Ghulam Abbas
249 students enrolled
English [Auto]
In depth understanding of unit testing
Will be able to unit testing a complete Node API
Understand all about Mocks, Spy and more
Nodejs unit testing & e2e testing using Jest
Testing a complete REST API
Learn how to write unit tests for errors
e2e testing of Node API
All about Jest
Basics of Test Driven Development (TDD)
How to generate Test Coverage Report
much more…

If you have any confusion or question about Unit testing in your mind, then you are at the right place. In this, In-depth Node.js Unit Testing course we will start from scratch and write units test with Jest.

Unit testing can be really confusing something especially if you are a beginner. In this course, we will start from the basics of Jest and then write units of a complete Jobs API that contains each and every example.

We will write unit tests for our controllers, models, utils, middleware, and much more. We will talk about how to handle error cases in Jest and how we can mock different libraries or packages.

You don’t need to be a Node.js expert for this course but you should know basic and should how to build an API. We will cover all the particle cases of unit testing.

We will also take a deep dive into the e2e Testing in which we will test our API from A-Z to make sure every part of the API is working as expected. We will also learn how to generate a Test Coverage Report with Jest which will give us an idea of how much code of our API is covered in Unit Testing and e2e Testing.

====== Topic Covered in this Unit Testing Course ======

  • Basics of Unit Testing in Jest

  • Testing API Controllers

  • Testing Middleware’s

  • Testing Models

  • Testing Utils

  • e2e Testing

  • Jest Test Coverage

  • Test Driven Development

  • React Unit Testing Basics – BONUS

If you are willing to learn or improve your Unit Testing skills then I will see you in the course!

Introduction

1
Introduction to the Course
2
What is Testing?

Setting up Environment

1
Installing all required tools

*** SOURCE CODE OF PROJECT ***

1
How to get Source code of project

Basics of Unit Testing in Jest

1
What is Jest?
2
Writing our first unit test
3
What is Mock or Mocking
4
mockImplementation and mockImplmentationOnce
5
Jest spyOn
6
Describe & it
7
beforeEach, afterEach, beforeAll, afterAll

Lets Unit Test Jobs API

1
Overview of Jobs API
2
Job API Config file
3
Mock Request & Mock Response
4
Mock User Model & bcryptjs
5
Unit Test Register User
6
Jest restoreAllMocks
7
Unit Test Register user Validation Error
8
Unit Test Duplicate Email Error
9
Unit Test Missing Login Email & Password
10
Unit Test Invalid Email or Password for Login
11
Unit Test Login User

Testing Jobs Resource

1
Jobs Controller Mocks
2
Testing Get All Jobs
3
Unit Test Create Job
4
Unit Test Create Job Validation error
5
Unit Test Get Job By ID
6
Unit Test CastError
7
Unit Test Update Job
8
Unit Test Unauthorized error
9
Unit Test Delete Job

Testing Middleware’s

1
Overview of auth middleware
2
Testing Missing Authorization header
3
Testing Missing JWT error
4
Unit testing auth middleware

Testing Models

1
Testing User Model
2
Testing User Model Validation error
3
Testing missing password

Testing Utils

1
Unit Testing getJwtToken
2
Unit Test sendEmail with Nodemailer
3
Overview of AWS S3 Class
4
Unit Test upload image to AWS S3

e2e Testing - Auth

1
Let’s start e2e testing
2
DB handler with mongodb-memory-server
3
Connecting & Closing DB
4
Testing Register user
5
Testing Login user
6
Testing 404 Routes

e2e Testing - Jobs Resource

1
Testing Get All Jobs
2
Testing Create new Job
3
Testing Get Job By Id
4
Testing Update Job
5
Testing Delete Job

Jest Test Coverage

1
Jest Testing Coverage

Test Driven Development (TDD)

1
What is Test Driven Development (TDD)
2
Writing Unit Test
3
Writing Endpoints

Bonus Lecture - Basic of React Unit Testing

1
Basic of React Unit Testing

Congratulations ?

1
Final Words
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
3.8
3.8 out of 5
31 Ratings

Detailed Rating

Stars 5
14
Stars 4
12
Stars 3
3
Stars 2
1
Stars 1
1