JavaScript Testing with Jasmine
JavaScript Behavior-Driven Development
Publisher: O'Reilly Media
Released: March 2013
Pages: 52

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
Table of Contents
Product Details
About the Author
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyJavaScript Testing with Jasmine
 
2.5

(based on 4 reviews)

Ratings Distribution

  • 5 Stars

     

    (0)

  • 4 Stars

     

    (0)

  • 3 Stars

     

    (3)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (1)

67%

of respondents would recommend this to a friend.

Pros

  • Easy to understand (3)

Cons

  • Not comprehensive enough (4)

Best Uses

  • Novice (4)
    • Reviewer Profile:
    • Developer (4)

Reviewed by 4 customers

Sort by

Displaying reviews 1-4

Back to top

 
1.0

by amateur and for amateur

By tkoomzaaskz

from internet

About Me Designer, Developer, Educator

Pros

  • Easy to understand

Cons

  • Not comprehensive enough
  • Too basic

Best Uses

  • Novice

Comments about oreilly JavaScript Testing with Jasmine:

The entire book is only about 50 pages. Its content is more or less the same as jasmine online docs (http://pivotal.github.io/jasmine/).

The BDD is not explained on a real project it's just mentioned (and after reading I can see no difference between BDD and TDD).

Most of jasmine functionalities are described how they can be used, but neither of the following are considered:
- when do you need to do this (in a real world project)
- how it works inside jasmine (in comparison, jQuery books explain how jQuery works internally).

It seems as the author didn't read his book after finishing it. In the last chapter he mentions that smething is done the same way as jasmine asynchronous tests - which are not mentioned before. By the way, you won't learn how to write asynchronous tests from this book.

I'm new to jasmine (that's why I read the book), but I don't feel my knowledge/skills have boosted. I think I'd get the same by reading online docs. An advanced developer will not learn much from it.

 
3.0

Know Jasmine and BDD with a tea time

By lyhcode

from Taiwan

About Me Developer

Verified Reviewer

Pros

  • Easy to understand
  • Helpful examples

Cons

  • Not comprehensive enough
  • Too basic

Best Uses

  • Novice
  • Student

Comments about oreilly JavaScript Testing with Jasmine:

Read this book and determine whether the Jasmine is helpful to your Test-driven and BDD project. Only takes tea time. The authors provide useful examples and brief explanation.

(2 of 2 customers found this review helpful)

 
3.0

Short "Getting Started With..." Tutorial

By steve

from Boulder, CO

About Me Developer

Verified Reviewer

Pros

  • Concise
  • Helpful examples

Cons

  • Not comprehensive enough

Best Uses

  • Novice

Comments about oreilly JavaScript Testing with Jasmine:

You should know right away: this book is short, 41 pages, stem to stern.

Jasmine is a free-and-open-source JavaScript testing application developed by Pivotal Labs and available on GitHub.

After some brief why-you-should-do-this throat-clearing, Hahn walks the reader through the development of a few simple JavaScript functions and the Jasmine "suites" for testing them. He starts from the very beginning, getting and installing the software and setting up the environment. He explains every line of code and describes additional features and options of the application along the way and includes very clear instructions for writing and running the test code.

With no experience testing JavaScript and only a little experience writing any software tests, this book was exactly the jump-start I needed. I duplicated the sample code in my IDE, goofed around with it a little bit, breaking it and extending it to see what happened and then was quickly able to start unit tests in my current project. Not well, at first, but with some confidence that I'd be able to figure things out.

The prose can get clunky. Not unclear or incoherent, just lacking in grace, and there is one serious code error, already noted in the errata page for the book at O'Reilly Media. Hahn makes no mention of the active community of developers using and extending Jasmine nor of Jasmine's shortcomings (it's not good at testing DOM manipulations without an additional plugin) – this is very much "How To Get Started With Jasmine".

Minus "why you should test your software" arguments and some enthusiastic coverage of CoffeeScript and Ruby, you're left with something roughly equivalent to a high-quality Web tutorial. That's nothing to sneeze at, but it's not "The Definitive Guide", either.

(6 of 8 customers found this review helpful)

 
3.0

Basic

By Exoer

from Trondheim, Norway

About Me Developer

Verified Reviewer

Pros

  • Concise
  • Easy to understand

Cons

  • Not comprehensive enough

Best Uses

  • Novice

Comments about oreilly JavaScript Testing with Jasmine:

Basic introduction to Jasmine. I have the impression that it is mostly a rehash of the documentation. Nothing about mocking out server requests. Separately testing server and client.

I missed deeper content on how to think like a tester and examples that are more relevant to frontend and backend development.

Displaying reviews 1-4

Back to top

 
Buy 2 Get 1 Free Free Shipping Guarantee
Buying Options
Immediate Access - Go Digital what's this?
Ebook: $11.99
Formats:  DAISY, ePub, Mobi, PDF
Print & Ebook: $16.49
Print: $14.99