Book Image

Jasmine Cookbook

By : Munish Kumar
Book Image

Jasmine Cookbook

By: Munish Kumar

Overview of this book

Table of Contents (16 chapters)
Jasmine Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

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 Module, ", function() {
      describe("When Convert Currency Across Region: ", function(){
        xit("Verify that Indian Rupees (INR) " +
            "converted to Us Dollars (USD)", function() {
        });
        xit("Verify that Indian Rupees (INR...