Chapter 10: Learning JavaScript Test-Driven Development by Example
by James Wright
Peer reviewed by Vildan Softic.
You're probably already familiar with automated testing and its benefits. Having a set of tests for your application allows you to make changes to your code with confidence, knowing that the tests have your back should you break anything. It's possible to take things a step further and write your tests before you write the code; a practice known as Test-driven development (TDD).
In this tutorial, we will talk about what TDD is and what benefits it brings to you as a developer. We'll use TDD to implement a form validator, which ensures that any values input by the user conform to a specified set of rules.
TDD in Node
Note that ...
Get Modern JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.