Jasmine Cookbook
eBook - ePub

Jasmine Cookbook

Munish Sethi

Share book
  1. 276 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Jasmine Cookbook

Munish Sethi

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Jasmine Cookbook an online PDF/ePUB?
Yes, you can access Jasmine Cookbook by Munish Sethi in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in JavaScript. We have over one million books available in our catalogue for you to explore.

Information

Jasmine Cookbook


Table of Contents

Jasmine Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Jasmine Framework
Introduction
Writing your first Jasmine test
Getting ready
How to do it...
How it works...
See also
Adding specs to your Jasmine test
How to do itā€¦
How it works...
See also
Adding expectations and matchers to the test
How to do itā€¦
How it works...
Applying different matchers to the Jasmine test
How to do itā€¦
How it works...
Applying setup and teardown functions to the Jasmine test
Getting ready
How to do itā€¦
How it works...
Using the "this" keyword
Getting ready
How to do itā€¦
How it works...
2. Jasmine with TDD and BDD Processes
Introduction
Writing Jasmine tests using TDD and BDD processes
Getting ready
How to do it...
How it works...
Creating a Jasmine test for new code using TDD and BDD
Getting ready
How to do it...
How it works...
Designing Jasmine tests for existing code using TDD and BDD
Getting ready
How to do it...
How it works...
Defining nested suites to write more meaningful specs
Getting ready
How to do it...
How it works...
3. Customizing Matchers and Jasmine Functions
Introduction
Writing a Jasmine test using a custom equality tester function
How to do it...
How it works...
Writing Jasmine tests with custom matchers
How to do it...
How it works...
Writing Jasmine tests for exceptions
How to do it...
How it works...
Declaring pending specs with Jasmine tests
Getting ready
How to do it...
4. Designing Specs from Requirement
Introduction
Writing useful specs by analyzing the test requirements
How to do it...
How it works...
Implementing the Jasmine test corresponding to the specs
How to do it...
How it works...
Applying Acceptance Criteria to the Jasmine test
How to do it...
How it works...
Organizing Jasmine specs into groups and subgroups
How to do it...
5. Jasmine Spies
Introduction
Writing Jasmine tests using the spyOn() method and special matchers for spies
Getting ready
How to do it...
How it works...
Writing Jasmine tests using tracking properties
How to do itā€¦
How it works...
Writing Jasmine tests with your own custom spy method
Getting ready
How to do it...
How it works...
Using jasmine.any and jasmine.objectContaining
Getting ready
How to do itā€¦
How it works...
Writing Jasmine tests to mock the JavaScript timeout functions
How to do itā€¦
How it works...
6. Jasmine with AJAX, jQuery, and Fixtures
Introduction
Writing Jasmine specs for AJAX
Getting ready
How to do it...
How it works...
Designing Jasmine specs with HTML and JSON fixtures
Getting ready
How to do it...
How it works...
Writing Jasmine specs for jQuery
Getting ready
How to do it...
How it works...
Writing Jasmine specs using custom jQuery matchers
Getting ready
How to do itā€¦
How it works...
Writing Jasmine specs for asynchronous operations using the done() function
How to do itā€¦
How it works...
7. Code Coverage with Jasmine Tests
Introduction
Configuring code coverage tools
Getting ready
How to do it...
How it works...
See also
Generating code coverage using karma and istanbul
Getting ready
How to do it...
How it works...
See also
Writing Jasmine specs for uncovered branches/code
How to do it...
How it works...
Increasing code coverage for existing code
How to do it...
How it works...
8. Jasmine with Other Tools
Introduction
Writing Jasmine tests for AngularJS
Getting ready
How to do it...
How it works...
Using Jasmine with CoffeeScript
Getting ready
How to do it...
How it works...
Writing Jasmine tests for Node.js
Getting ready
How to do it...
How it works...
9. Developing JavaScript Apps Using Jasmine ā€“ a Real-time Scenario
Introduction
Defining Jasmine specs corresponding to a user story
Getting ready
How to do it...
See also
Implementing Jasmine specs with Web/HTML
Getting ready
How to do it...
How it works...
Implementing Jasmine tests with a Data-Driven approach
How to do it...
Creating Jasmine tests for a change request
Getting ready
How to do it...
Index

Jasmine Cookbook

Copyright Ā© 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2015
Production reference: 1200415
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-716-6
www.packtpub.com

Credits

Author
Munish Sethi
Reviewer
Devin Weaver
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Larissa Pinto
Content Development Editor
Ajinkya Paranjape
Technical Editor
Vivek Pala
Copy Editors
Pranjali Chury
Kriti Sharma
Project Coordinator
Harshal Ved
Proofreaders
Martin Diver
Elinor Perry-Smith
Paul Hindle
Indexer
Mariammal Chettiyar
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur
2323__pe...

Table of contents