James Bender
Yes, You Need to Unit Test your JavaScript. Here's How.
#1about 7 minutes
Why developers avoid unit testing JavaScript
Common excuses for not unit testing are addressed by framing tests as a long-term investment that prevents project slowdowns.
#2about 5 minutes
Understanding the Test-Driven Development workflow
TDD inverts the traditional development process by using specifications to write automated tests before writing the implementation code.
#3about 7 minutes
The core characteristics of a good unit test
Effective unit tests are isolated from dependencies, targeted to a single scenario, and repeatable regardless of external factors.
#4about 5 minutes
Applying the red-green-refactor TDD cycle
The core TDD loop involves writing a failing test (red), writing minimal code to pass it (green), and then improving the code's design (refactor).
#5about 2 minutes
Choosing a JavaScript testing framework: Jest vs Jasmine
Jest is recommended over Jasmine primarily for its performance benefits, as it runs tests in a multi-threaded environment.
#6about 8 minutes
Writing your first basic unit test with Jest
A live coding demonstration introduces the basic Jest syntax, including the `test`, `expect`, and `toBe` functions for a simple sum operation.
#7about 14 minutes
Live coding a Tic-Tac-Toe game using TDD
This demonstration builds a simple game engine by following the red-green-refactor cycle and using BDD-style tests with `describe` and `it`.
#8about 2 minutes
Practical next steps for adopting unit testing
Actionable advice for teams includes starting with new features, practicing daily, sharing knowledge, and measuring code coverage.
#9about 9 minutes
Audience Q&A on testing strategies
Questions from the audience are answered, covering topics like integration testing in React, handling front-end tests, and involving product teams.
Related jobs
Jobs that call for the skills explored in this talk.
Matching moments
1:28:47 MIN
Recap and practical advice for testing applications
Test Driven Development with JavaScript
03:20 MIN
Why JavaScript and TypeScript dominate modern development
Modern Headless Commerce with Vendure
36:52 MIN
Q&A on BDD and testing untestable code
How to TDD in legacy code
10:27 MIN
Building a testing foundation with unit tests
Trunk-Based Development at Scale: Real-World Insights from a High-Traffic Luxury E-Commerce Platform
19:21 MIN
Lessons on testing, hooks, and framework lock-in
Building a large, complex product from the ground up with typescript & Atomic Design:lessons learned
00:58 MIN
Why developers often view unit testing as a chore
Test-reduction - Doing more with less
30:50 MIN
How to convince your team to adopt TypeScript
4 Steps from JavaScript to TypeScript
01:24 MIN
Identifying the common pains of software testing
Write tests you love, not hate
Featured Partners
Related Videos
Write tests you love, not hate
Jens Happe
The 2025 State of JavaScript Testing
Daniel Afonso
TDD for Vue.js Developers
Markus Oberlehner
How to TDD in legacy code
Gil Zilberfeld
Test Driven Development with JavaScript
Sascha Depold & Parinaz Roghany
Why you must use TDD now!
Alex Banul
Catching up on the basics you don't really need that much code
Chris Heilmann
How not to test
Golo Roden
From learning to earning
Jobs that call for the skills explored in this talk.

Test System and Release Engineer (m/w/d)
AKDB Anstalt für kommunale Datenverarbeitung in Bayern
München, Germany
Intermediate
Senior
JavaScript
Automated Testing

Software Tester (f/m/d)
Power Plus Communications
Mannheim, Germany
Intermediate
Senior
Python
Unit Testing
Automated Testing


Lead Full-Stack Engineer
Hubert Burda Media
München, Germany
€80-95K
Intermediate
Senior
React
Vue.js
Node.js
MongoDB
+1

Software Engineer
tree-IT GmbH
Bad Neustadt an der Saale, Germany
Remote
€54-80K
Intermediate
Senior
Java
TypeScript
Spring Boot

Lead Fullstack Engineer AI
Hubert Burda Media
München, Germany
€80-95K
Intermediate
React
Python
Vue.js
Langchain
+1

SENIOR SOFTWARE TEST MANAGER (M/W/D)
Wilken GmbH
Ulm, Germany
Intermediate
Java
JIRA
Selenium
Unit Testing
Automated Testing

Senior AI Software Developer & Mentor
Dynatrace
Linz, Austria
Senior
Java
TypeScript
AI Frameworks
Agile Methodologies
