O'Reilly logo

Jasmine Cookbook by Munish Sethi

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

Implementing the Jasmine test corresponding to the specs

In the previous recipe, Writing useful specs by analyzing the test requirements, we defined the Jasmine specs against test requirements. In this recipe, you will learn to write Jasmine tests and the corresponding JavaScript code for the specs designed in the previous recipe. For details, please refer to the previous recipe in this chapter.

How to do it...

You need to perform the following steps to write Jasmine tests corresponding to the specs:

  1. First, you need to create a spec file (CurrencyConverter_tests_spec.js) under the /spec folder and get the following code from the spec file (CurrencyConverter_spec.js) created in the previous recipe:
    describe("<ABC> Money Exchange Company: Currency Converter ...

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