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 using TDD and BDD processes

To write a Jasmine test using TDD and BDD, let's assume that we are developing a payroll application for <XYZ> company. The employees of <XYZ> company work in India, UK, and the US. As per immediate need, a Tax (that is, Tax Deduction at Source) module needs to be developed to deduct an employee's tax in salary disbursement. There are different business rules that exist for deducting tax across different countries.

"As payroll administrator, I want to calculate an employee's tax on salary disbursement so that I can evaluate the exact tax."

Let's consider some scenarios in the context that an employee's tax should be deducted on salary disbursement:

  • Scenario-1: Tax should be deducted in currency INR (India Rupee, Rs) for Indian employees
  • Scenario-2: Tax should be deducted in currency GBP (British Pound, UK £) for UK employees
  • Scenario-3: Tax should be deducted in currency USD (US Dollar, $) for...
You have been reading a chapter from
Jasmine Cookbook
Published in: Apr 2015
Publisher:
ISBN-13: 9781784397166
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