Test Driven Development (TDD) is a process for writing software that provably satisfies the software requirements. The process works like this:
This workflow is commonly known as Red, Green Refactor.
When you dig into TDD you’re going to find a bunch of options for test frameworks. Let me save you some time: Which one you pick matters less than how simple your test suite is. Some of the fancier ones (Mocha, Jasmine) tend to encourage users to produce overly-complicated tests, but if you follow the advice in this article, almost any framework will suffice.
In fact, if you’re not testing a large app, a simple vanilla-js test suite is probably fine:
... read the whole story at medium.com.