Start reading JavaScript Testing with Jasmine on your Kindle in under a minute. Don't have a Kindle? Get your Kindle here or start reading now with a free Kindle Reading App.

Deliver to your Kindle or other device


Try it free

Sample the beginning of this book for free

Deliver to your Kindle or other device

JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development

JavaScript Testing with Jasmine: JavaScript Behavior-Driven Development [Kindle Edition]

Evan Hahn
4.0 out of 5 stars  See all reviews (2 customer reviews)

Print List Price: £9.50
Kindle Price: £8.23 includes VAT* & free wireless delivery via Amazon Whispernet
You Save: £1.27 (13%)
* Unlike print books, digital books are subject to VAT.

Free Kindle Reading App Anybody can read Kindle books—even without a Kindle device—with the FREE Kindle app for smartphones, tablets and computers.

To get the free app, enter your e-mail address or mobile phone number.


Amazon Price New from Used from
Kindle Edition £8.23  
Paperback £9.50  
Kindle Daily Deal
Kindle Daily Deal: At least 60% off
Each day we unveil a new book deal at a specially discounted price--for that day only. Learn more about the Kindle Daily Deal or sign up for the Kindle Daily Deal Newsletter to receive free e-mail notifications about each day's deal.

Product Description

Product Description

Get a concise introduction to Jasmine, the popular behavior-driven testing framework for JavaScript. This practical guide shows you how to write unit tests with Jasmine that automatically check for bugs in your application. If you have JavaScript experience—with knowledge of some advanced features—you’ll learn how to write specifications for individual components, and then use those specs to test the code you write.

Throughout the book, author Evan Hahn focuses primarily on methods for testing browser-based JavaScript applications, but you’ll also discover how to use Jasmine with CoffeeScript, Node.js, Ruby on Rails, and Ruby without Rails. You won’t find a more in-depth source for Jasmine anywhere.

  • Get an overview of both test-driven and behavior-driven development
  • Write useful specs by determining what you need to test—and what you don’t
  • Test the behavior of new and existing code against the specs you create
  • Apply Jasmine matchers and discover how to build your own
  • Organize code suites into groups and subgroups as your code becomes more complex
  • Use a Jasmine spy in place of a function or an object—and learn why it’s valuable

About the Author

Evan is a JavaScript developer currently enrolled at University of Michigan. He started coding in BASIC when he was 6 years old. In high school, he was the webmaster of his high school's online newspaper, where he learned how to make more of a real website (PHP, mySQL, JavaScript, jQuery).

He most recently worked at UniversityNow, an educational startup in Palo Alto.

Product details

  • Format: Kindle Edition
  • File Size: 493 KB
  • Print Length: 52 pages
  • Simultaneous Device Usage: Unlimited
  • Publisher: O'Reilly Media; 1 edition (25 Mar 2013)
  • Sold by: Amazon Media EU S.à r.l.
  • Language: English
  • ASIN: B00C10Y9BS
  • Text-to-Speech: Enabled
  • X-Ray:
  • Word Wise: Not Enabled
  • Average Customer Review: 4.0 out of 5 stars  See all reviews (2 customer reviews)
  • Amazon Bestsellers Rank: #299,222 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images?

More About the Author

Discover books, learn about writers, and more.

What Other Items Do Customers Buy After Viewing This Item?

Customer Reviews

5 star
3 star
2 star
1 star
4.0 out of 5 stars
4.0 out of 5 stars
Most Helpful Customer Reviews
4.0 out of 5 stars Js testing for beginners and experts 31 July 2014
Format:Paperback|Verified Purchase
Well written easy to understand both for beginners and expert.
If you need a way to test you js. That's it
Comment | 
Was this review helpful to you?
4.0 out of 5 stars Four Stars 8 Aug 2014
Format:Paperback|Verified Purchase
Useful book, a bit short and therefore expensive but I would recommend it
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on (beta) 3.2 out of 5 stars  11 reviews
3 of 3 people found the following review helpful
3.0 out of 5 stars Solid reference, could have been more 24 April 2013
By Ben M - Published on
I received a copy of Javascript Testing with Jasmine by Evan Hahn this week, and it seemed like perfect timing. The developers on my team at work have been discussing using Jasmine to automate the testing of Javascript code in our product, and I may be spending a significant amount of time with it soon. I was hoping to pick up on some tips and tricks, and maybe learn some things about testing. It ended up being a quick read with some useful tidbits that left me wanting more.

What is it?

Javascript Testing with Jasmine is a short little book about testing with Jasmine, a testing framework inspired by the Behavior Driven Development style. The book is short (only 52 pages), which is appropriate for its limited scope. It's split into 7 chapters with each chapter comprised of a few pages of example and explanation:

What is Software testing?
Writing good tests
Matchers in depth
More Jasmine Features
Using Jasmine with other tools
What's it like?

Unfortunately the book manages to simultaneously feel like its filling space in many spots, and like it missed opportunities to provide value in others. Chapters 4 and 5 for instance fail to say much that is not already in Jasmine's "describe by showing"-style documentation. Chapter 1 seems to be searching for interesting things to say about testing, and failed to meaningfully explain the distinction between BDD and generic Test Driven Development. The section on Jasmine and Coffeescript in Chapter 7 could be succinctly summarized as "Yes you can use Jasmine with Coffeescript". At the same time, the book misses opportunities to talk about things like writing testable code, or refactoring existing code to be meaningfully tested with Jasmine. I would have loved to see more about automating testing and fitting it into the development process, or running tests from the command line with phantomJS.

Thats not to say that there's nothing good here. I found the explanation of spies to be very helpful, and the detailed documentation-like aspects would be more helpful to a Javascript beginner than Jasmine's "show me the code" docs. All in all the book serves as a great reference guide for the library. I'm just not sure how much value it adds compared to a quick Google search.


In the end this feels like the type of book that made sense before Google took over the Internet. It provides all the basic how-tos and background information, but fails to provide any deep insight. If you're starting a new Javascript BDD project and want a quick reference this may make sense as a quick reference guide, but for most people the information in here can be found just as easily with a little use of your favorite search engine and a trip to the Jasmine docs.
2 of 2 people found the following review helpful
3.0 out of 5 stars a short "guided tour" of Jasmine 5 May 2013
By R. Friesel Jr. - Published on
Evan Hahn did us a favor and slapped together this primer for us. It's short (around 50 pages), so you can burn through it in an afternoon, but he hits the high notes and (most importantly) provides a clear path for how to get started using Jasmine.

As a testing library, Jasmine itself is pretty approachable. It does not have a steep learning curve, and you can get some valuable results quickly just by diving in. But if you're looking for a kind of... "guided tour" to help orient you to the library (and JavaScript testing in a more general sense) then that is where this book comes in. Hahn has peppered the text with some discussion TDD and BDD, and in some chapters there is almost as much discussion of these general development philosophies than there is of Jasmine specifically.

The book's greatest strength (that it is so focused and concise) is also its greatest weakness -- you may reach the end and wonder: "OK, what next?" Its coverage, while broad, is not particularly deep. This isn't much of a criticism though -- how deep into the innards can you really get before you're just talking about the low-level source code? In addition to the "guided tour" approach taken by most of the book, I also appreciated the quick-and-dirty "Using Jasmine with Other Tools" chapter near the end, which is a series of overviews dedicated to the major integrations that exist. (That being said, the overviews of those integrations are just that: shallow overviews, and I would have liked to have seen at least one _really_ deep dive.)

By itself, Hahn's book is a good intro to the subject (Jasmine, and JavaScript testing), and works best if you're looking for a kind of "guided tour" to help you get started. And if you are just looking for something focused on Jasmine, then this is great; and/but if you are looking for a more thorough treatment of the subject (i.e., JavaScript testing) then you'll want to check out something like Mark Ethan Trostler's Testable JavaScript.

[FULL DISCLOSURE] I received an electronic copy of this book from the publisher in exchange for writing this review.
1 of 1 people found the following review helpful
2.0 out of 5 stars Useful but SHORT 28 Jan 2014
By Benjamin Shine - Published on
Format:Kindle Edition|Verified Purchase
I can't believe how short this is. I read it entirely in less than an hour. It's useful, but I'm not sure it's worth $13.50.
1 of 1 people found the following review helpful
3.0 out of 5 stars Get going fast, but then what? 17 Jan 2014
By Trisha Davis - Published on
Format:Kindle Edition
I got this book from my local user group because I wanted to get up-to-speed with testing in Javascript. I dislike books that are hundreds of pages because most of them are fluff. This book, however, is a perfect 52 pages and I read through it in about an hour. While It does get you going with Jasmine as it promises, it doesn't quite get you to a point where you can integrate Jasmine + tests with your Javascript code nor does it discuss testable code.

As others have said, the book has the opportunity but fails to deliver a complete package. But, as far as learning Jasmine syntax, it was quick and painless and to the point. I recommend borrowing the book from a friend or reading about Jasmine online instead of purchasing the book.
1 of 1 people found the following review helpful
4.0 out of 5 stars Simple Book, But Clear and Concise 14 Oct 2013
By Joshua Bremer - Published on
Format:Kindle Edition|Verified Purchase
It isn't a big book, but the content was easy to digest and gave me a good understanding of starting Jasmine.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for similar items by category