Autoplay
Autocomplete
Previous Lesson
Complete and Continue
JavaScript Unit Testing - The Practical Guide
Getting Started
Welcome To This Course! (0:54)
What Is Testing? (4:41)
Unit Testing: What & Why? (4:33)
Unit vs Integration vs E2E Tests (5:51)
A Quick Note About Test-Driven Development (TDD) (1:35)
About This Course (6:42)
Join Our Learning Community
Course Resources & Project Snapshots
Setup & Testing Software
Module Introduction (1:09)
Which Tools Are Needed For Testing? (6:27)
Jest & Vitest (6:56)
Installing Vitest (1:36)
Course Project Setup (7:59)
Testing Basics
Module Introduction (1:19)
Basic Test File & Project Setup (7:04)
Writing a First Test (6:54)
Running Tests (4:18)
Why Are We Testing? (3:02)
The AAA Pattern - Arrange, Act, Assert (4:36)
Keep Your Tests Simple! (1:34)
Defining Behaviors & Fixing Errors In Your Code (7:38)
Demo: Writing More Tests (4:36)
Testing For Errors (4:14)
Demo: Adding More Tests (3:28)
Testing For Thrown Errors & Error Messages (4:58)
Exercise: Problem (1:44)
Exercise: Solution (4:46)
Tests With Multiple Assertions (Multiple Expectations) (5:18)
More Practice! (2:55)
Introducing Test Suites (4:39)
Adding Tests To Frontend & Backend Projects (3:36)
Module Summary (2:22)
Writing Good Tests
Module Introduction (1:25)
What To Test & Not To Test (6:03)
Writing Good Tests - An Overview & Summary (4:36)
Only Test "One Thing" (2:02)
Splitting Functions For Easier Testing & Better Code (5:01)
Refactoring Code (10:13)
Formulating Different Expectations (6:07)
A Word About Code Coverage
Module Summary (2:01)
Integration Tests
Module Introduction (0:57)
Introducing Integration Tests (2:23)
Writing an Integration Test & Reasoning (5:51)
Testing For Errors (2:28)
Integration vs Unit Tests: Finding the Right Balance (3:24)
Advanced Testing Concepts
Module Introduction (1:06)
toBe() vs toEqual() (4:21)
The Problem With Asynchronous Code (6:13)
Testing Asynchronous Code With Callbacks (5:02)
Testing Asynchronous Code With Promises & async / await (4:32)
Returning Promises In Tests
Getting Started with "Testing Hooks" (1:42)
Why Hooks? (4:39)
Using Testing Hooks (beforeEach, beforeAll, afterEach, afterAll) (6:13)
Concurrent Tests (2:14)
Concurrency & Default Behavior
Module Summary (1:48)
Mocking & Spies: Dealing with Side Effects
Module Introduction (1:03)
The Starting Project (4:11)
The Problem With Side Effects & Tests (6:24)
Introducing Spies & Mocks (2:07)
Working with Spies (5:13)
Getting Started with Mocks & Automocking (5:18)
Note on Mocking (2:18)
Notes on Spies (1:30)
Custom Mocking Logic (7:51)
Managing Custom Mock Implementations Globally (__mocks__ Folder) (6:11)
More Mocking Functionalities (1:34)
Module Summary (1:00)
More on Mocking & Diving Deeper
Module Introduction (1:04)
The Starting Project (3:02)
Refresher: Practicing Basic Tests (1) (6:25)
Refresher: Practicing Basic Tests (2) (4:43)
Reasons to Mock (2:11)
Mocking Global Values & Functions (8:13)
Mocking Frontend Libraries
Test-specific Mocking Logic (6:59)
Mocking In Selected Places (5:21)
Using Local Mock Values (7:01)
Module Summary (1:16)
Testing & The DOM (Frontend JavaScript Testing)
Module Introduction (1:14)
Understanding the Problem (3:58)
Working with Different Testing Environments (3:42)
Setting up a Virtual HTML Page (5:05)
Testing DOM Functionalities (2:58)
DOM Tests & Cleanup Work (3:12)
Finishing Example (1:32)
A Brief Look at the "Testing Library" Package (1:53)
Module Summary (1:08)
Course Roundup
Course Roundup (4:10)
Bonus: More Courses & Content
Refresher: Practicing Basic Tests (2)
Lesson content locked
If you're already enrolled,
you'll need to login
.
Enroll in Course to Unlock