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.
Hubert Burda Media
München, Germany
€80-95K
Intermediate
Senior
JavaScript
Node.js
+1
Matching moments
01:32 MIN
Organizing a developer conference for 15,000 attendees
Cat Herding with Lions and Tigers - Christian Heilmann
04:22 MIN
Why HR struggles with technology implementation and adoption
What 2025 Taught Us: A Year-End Special with Hung Lee
11:32 MIN
The industry's focus on frameworks over web fundamentals
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
04:57 MIN
Developing resilience by expanding your capacity for failure
What 2025 Taught Us: A Year-End Special with Hung Lee
02:44 MIN
Rapid-fire thoughts on the future of work
What 2025 Taught Us: A Year-End Special with Hung Lee
03:28 MIN
Why corporate AI adoption lags behind the hype
What 2025 Taught Us: A Year-End Special with Hung Lee
11:10 MIN
The only frontend stack that truly matters
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
14:14 MIN
Scripting presentations and demos in VS Code
Devs vs. Marketers, COBOL and Copilot, Make Live Coding Easy and more - The Best of LIVE 2025 - Part 3
Featured Partners
Related Videos
Write tests you love, not hate
Jens Happe
TDD for Vue.js Developers
Markus Oberlehner
The 2025 State of JavaScript Testing
Daniel Afonso
How to TDD in legacy code
Gil Zilberfeld
Why you must use TDD now!
Alex Banul
Test Driven Development with JavaScript
Sascha Depold & Parinaz Roghany
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
Chris Heilmann, Daniel Cranney & Jan Deppisch
How not to test
Golo Roden
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.

Eltemate
Amsterdam, Netherlands
Intermediate
Senior
TypeScript
Automated Testing
Continuous Integration

Confideck GmbH
Vienna, Austria
Remote
Intermediate
Senior
Node.js
MongoDB
TypeScript


MARKT-PILOT GmbH
Stuttgart, Germany
Remote
€75-90K
Senior
Java
Angular
TypeScript


Douglas GmbH
Düsseldorf, Germany
Intermediate
Senior
React
TypeScript

Power Plus Communications
Mannheim, Germany
Intermediate
Senior
Python
Unit Testing
Automated Testing


Frontend Revolution
Amsterdam, Netherlands
Angular
JavaScript
Test Driven Development