Jasmine is a powerful JavaScript unit testing framework. It provides a clean mechanism for testing synchronous and asynchronous JavaScript code. Jasmine is a behavior-driven development framework that provides descriptive test cases that focus more on the business value than on the technical details. Because it is written in a simple natural language, Jasmine tests can be read by non-programmers and can provide a clear description when a single test succeeds or fails and also the reason behind its failure. In this chapter, the framework will be illustrated in detail and will be used to test the weather application that is discussed in Chapter 1, Unit Testing JavaScript Applications.
Note
Behavior-driven development (BDD) is an agile software development technique introduced by Dan North that focuses on writing descriptive tests from the business perspective. BDD extends TDD by writing test cases that test the software behavior (requirements) in a natural language that anyone...