Chapter 2. Jasmine with TDD and BDD Processes

In this chapter, we will cover:

  • Writing Jasmine tests using TDD and BDD processes
  • Creating a Jasmine test for new code using TDD and BDD
  • Designing Jasmine tests for existing code using TDD and BDD
  • Defining nested suites to write more meaningful specs

Introduction

Behavior-Driven Development (BDD) is a software development process based on Test-Driven Development (TDD). Before we start writing Jasmine tests using TDD and BDD, let's get a briefing of how both processes work and how they play a pivotal role in software development.

TDD is a unit testing based test-first or fail-first approach where we write the test before writing the code. Thereafter, we write the minimum amount of code just to pass the test. ...

Get Jasmine Cookbook 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.