Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
JavaScript Testing with Jasmine
JavaScript Testing with Jasmine
Evan Hahn
Special Upgrade Offer
Preface
Who Should Read This Book
Conventions Used in This Book
Tip
Using Code Examples
SafariĀ® Books Online
Note
How to Contact Us
Acknowledgments
Chapter 1. Intro to Testing
What Is Software Testing?
Why Is It Useful?
Test-Driven Development
Behavior-Driven Development
Note
Chapter 2. Jasmine
What Is Jasmine?
Getting Set Up with Jasmine
Note
Testing Existing Code with describe, it, and expect
An Example to Test
Jasmine Time!
Matchers
Writing the Tests First with Test-Driven Development
Chapter 3. Writing Good Tests
Cardinal Rule: When in Doubt, Test
Test Components
Black-Box Testing
Chapter 4. Matchers in Depth
Equality: toEqual
Identity: toBe
Yes or No? toBeTruthy, toBeFalsy
Negate Other Matchers with not
Check If an Element Is Present with toContain
Is It Defined? toBeDefined, toBeUndefined
Nullness: toBeNull
Is It NaN? toBeNaN
Note
Comparators: toBeGreaterThan, toBeLessThan
Nearness: toBeCloseTo
Using toMatch with Regular Expressions
Checking If a Function Throws an Error with toThrow
Custom Matchers
Chapter 5. More Jasmine Features
Before and After
Nested Suites
Skipping Specs and Suites
Matching Class Names
Chapter 6. Spies
The Basics: Spying on a Function
Calling Through: Making Your Spy Even Smarter
Making Sure a Spy Returns a Specific Value
Replacing a Function with a Completely Different Spy
Creating a New Spy Function
Creating a New Spy Object
Chapter 7. Using Jasmine with Other Tools
Jasmine and CoffeeScript
Jasmine and Node.js
Installing jasmine-node on Unix and Linux
Installing jasmine-node on Windows
Basic Usage
Asynchronous Tests with jasmine-node
jasmine-node and CoffeeScript
Jasmine and Ruby on Rails
Installation
Usage
Jasmine with Non-Rails Ruby
More Tools
Chapter 8. Reference
Jasmine on the Web
The Basic Structure of a Suite
Matchers Reference
List of Falsy Values
Reserved Words in Jasmine
About the Author
Colophon
Special Upgrade Offer
JavaScript Testing with Jasmine
Evan Hahn
Editor
Mary Treseler
← Prev
Back
Next →
← Prev
Back
Next →