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

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 US employees

  • Scenario-4: Tax of Indian...