Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Jasmine Cookbook

You're reading from   Jasmine Cookbook Over 35 recipes to design and develop Jasmine tests to produce world-class JavaScript applications

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher
ISBN-13 9781784397166
Length 276 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Munish Kumar Munish Kumar
Author Profile Icon Munish Kumar
Munish Kumar
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Started with Jasmine Framework 2. Jasmine with TDD and BDD Processes FREE CHAPTER 3. Customizing Matchers and Jasmine Functions 4. Designing Specs from Requirement 5. Jasmine Spies 6. Jasmine with AJAX, jQuery, and Fixtures 7. Code Coverage with Jasmine Tests 8. Jasmine with Other Tools 9. Developing JavaScript Apps Using Jasmine – a Real-time Scenario Index

Writing Jasmine tests for AngularJS


AngularJS is a JavaScript framework. It extends HTML attributes with directives and binds data to HTML with expressions. The scope of this recipe is to create Jasmine tests for AngularJS code. To know more about AngularJS, you can visit the following website:

https://docs.angularjs.org/guide/introduction

In this recipe, you will learn how to create Jasmine tests for AngularJS.

To understand this recipe, let's assume that you are developing an application for a bank with AngularJS framework and you have to develop test code to implement business logic for opening a new bank account.

"As an AngularJS developer, I want to implement business logic to validate a person's age so that I can implement a test condition successfully."

Let's consider some scenarios in the current context, that is, a person's age should be greater than or equal to 18 years to open a bank account:

  • Scenario-1: Person should be eligible to open bank account if age is greater than or equal...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image