JavaScript Unit Testing - The Practical Guide
Learn how to write automated tests (unit & integration tests) for your JavaScript projects with Vitest & Jest.
Watch Promo Enroll in Course
Automated testing is a key concept in modern (web) development.
Yet it is a concept that can be intimidating at first, hence many developers shy away from diving into testing and adding tests to their projects.
This course will teach you automated unit & integration testing with JavaScript from the ground up. You will learn how tests are written and added to your projects, what should (and should not) be tested and how you can test both simple as well as more complex code.
You will learn about the software and setup required to write automated tests and example projects will be provided as part of the course. It's a hands-on, practical course, hence you won't get stuck in theory - instead you'll be able to learn all key concepts at real examples.
In the course, Vitest will be used as the main testing library & tool. It's a modern JavaScript test runner and assertion library that provides Jest compatibility. Hence what you'll learn in this course will help you no matter if you're working with Vitest or Jest. And the core concepts will apply, no matter which testing setup you're using at all!
As part of this course, typical testing problems will be defined and solved and common strategies like mocking or working with spies are taught in great detail. This course also does not focus on specific types of JavaScript projects - neither does it focus on any specific library or framework.
Instead, you'll learn how to automatically test your (vanilla) JavaScript code, no matter if it's a NodeJS or frontend project. The fundamentals you'll gain in this course will help you in all your future projects - backend (NodeJS) and frontend (vanilla JS, React, Vue, Angular) alike.
This course will provide you with an extremely solid foundation to build up on, such that you can start adding tests to all your JavaScript projects.
In detail, this course will teach you:
- What exactly "testing" or "automated testing" is (and why you need it)
- What "unit testing" is specifically
- Which tools you need to enable automated unit tests in your projects
- How to write unit tests
- How to get started with integration tests
- How to formulate different expectations (assertions)
- Which patterns to follow when writing tests
- How to test asynchronous and synchronous code
- How to deal with side effects with help of spies & mocks
- How to apply all these concepts in real projects & examples
5+
hours
80+
lessons
Course Curriculum
-
PreviewWelcome To This Course! (0:54)
-
PreviewWhat Is Testing? (4:41)
-
PreviewUnit Testing: What & Why? (4:33)
-
PreviewUnit vs Integration vs E2E Tests (5:51)
-
PreviewA Quick Note About Test-Driven Development (TDD) (1:35)
-
PreviewAbout This Course (6:42)
-
PreviewJoin Our Learning Community
-
PreviewCourse Resources & Project Snapshots
-
StartModule Introduction (1:19)
-
StartBasic Test File & Project Setup (7:04)
-
StartWriting a First Test (6:54)
-
StartRunning Tests (4:18)
-
StartWhy Are We Testing? (3:02)
-
StartThe AAA Pattern - Arrange, Act, Assert (4:36)
-
StartKeep Your Tests Simple! (1:34)
-
StartDefining Behaviors & Fixing Errors In Your Code (7:38)
-
StartDemo: Writing More Tests (4:36)
-
StartTesting For Errors (4:14)
-
StartDemo: Adding More Tests (3:28)
-
StartTesting For Thrown Errors & Error Messages (4:58)
-
StartExercise: Problem (1:44)
-
StartExercise: Solution (4:46)
-
StartTests With Multiple Assertions (Multiple Expectations) (5:18)
-
StartMore Practice! (2:55)
-
StartIntroducing Test Suites (4:39)
-
StartAdding Tests To Frontend & Backend Projects (3:36)
-
StartModule Summary (2:22)
Course Prerequisites
Basic JavaScript knowledge is required
NO prior testing knowledge is necessary at all
All pre-requisites are covered by courses in our "Academind Pro" Membership.
30 Day Money Back Guarantee - No Questions Asked!
Our courses helped thousands of students learn something new and improve their lives.
We're so convinced by our course quality that we guarantee your success and provide a full refund within the first 30 days if you're not happy with the course.
Your Instructor
As a self-taught professional I really know the hard parts and the difficult topics when learning new or improving on already-known languages. This background and experience enable me to focus on the most relevant key concepts and topics. My track record of many 5-star rated courses, more than 2,500,000 students worldwide as well as a successful YouTube channel with 900.000 subscribers is the best proof for that.
The most rewarding experience for me is to see how people find new, better jobs, build awesome web applications, work on amazing projects or simply enjoy their hobby with the help of my content.
That's why, together with Manuel Lorenz, I founded Academind to offer the best possible learning experience and to share the pleasure of learning with our students.
Frequently Asked Questions
Join 4165 happy students!
Single-Course License
Full access to "JavaScript Unit Testing - The Practical Guide
$69
Access to this course only.
This is a one-time payment that grants access to this course only, not to any other courses.
Academind Pro Membership
Unlimited access to this and all other current & future courses!
$25/month
Cancel Anytime!
This is a recurring payment, charged automatically on a monthly basis. You can cancel anytime from inside your user profile to avoid being charged again once your billing cycle ends. For more information, please contact Academind.