O'Reilly logo

Angular Test-Driven Development - Second Edition by Md. Ziaul Haq

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Practical TDD with JavaScript

Let's dive into practical TDD in the context of JavaScript. This walk through will take us through the process of adding the multiplication functionality to a calculator.

Just keep the TDD life cycle, as follows, in mind:

  • Test first
  • Make it run
  • Make it better

Point out the development to-do list

A development to-do list helps organize and focus on tasks individually. It also helps provide a platform to list down ideas during the development process, which could be a single feature later on.

Let's add the first feature in the development to-do list--the add multiplication functionality:

3 * 3 = 9

The preceding list describes what needs to be done. It also provides a clear example of how to verify the multiplication 3 * 3 = ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required