Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

Test-driven development (TDD)

Test-driven development is a testing methodology that focuses on encouraging developers to write tests before they write application code. Usually, the process of writing code in TDD consists of the following basic steps:

  1. Write a test that fails. There is no application code at this point, so the test should fail.
  2. Run the test and ensure that it fails.
  3. Write the code to pass the test.
  4. Run the test and ensure that it works.
  1. Run all the other existing tests to ensure that no other parts of the application are broken because of the changes.
  2. Repeat the process for every new feature or bug fix.

This process is often represented as the "red-green-refactor" diagram:

The choice between using TDD or not comes down ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content