This is simple, practical step by step tutorial of test-driven development(TDD) in JavaScript. In this tutorial, you’ll learn how to implement simple TDD scenario in JavaScript. I use VSCode.
We’ll use the concept of Red-Green Refactor(RGF) which is made up of three parts;
- Red – First write a test that fails. It fails because you’ve not actually written the code yet
- Green – Write a code that passes your test as well as all previous tests
- Refactor – Then you refactor the code