Jump to ratings and reviews
Rate this book

Jasmine JavaScript Testing - Second Edition

Rate this book
Test your JavaScript applications efficiently using Jasmine and React.js This book is for web developers and designers who work with React.js and JavaScript and who are new to unit testing and automation. It's assumed that you have a basic knowledge of JavaScript and HTML. Take your testing of JavaScript applications to a new level of efficiency and reliability with the help of this book. Starting with the fundamentals of Jasmine and behavior-driven development (BDD), you will learn about tooling and automation. You will learn how to create a sustainable code base with the help of Jasmine. You will also take a look at integrated testing with React.js and Karma, and how you can speed this process up by faking AJAX requests. As you progress through the book, you will learn about the challenges of testing an application built on top of a framework and how you can prevent your application from suffering from dependency management. You will understand the concept of client-side and server-side rendering and test applications using React.js. You will also learn to automate using webpack and work with JavaScript module systems using ECMA Script 6 (ES6) modules. By the end of this book, you will be a competent web developer with good knowledge and a strong understanding of how to efficiently use the Jasmine framework for testing purposes.

134 pages, Paperback

First published January 1, 2013

8 people are currently reading
22 people want to read

About the author

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
3 (10%)
4 stars
8 (27%)
3 stars
13 (44%)
2 stars
4 (13%)
1 star
1 (3%)
Displaying 1 - 6 of 6 reviews
Profile Image for Rob.
Author 2 books445 followers
September 27, 2013
Packt Publishing recently released Jasmine JavaScript Testing by Paulo Ragonha (@pirelenito), and I just wrapped up reading it this morning. I’ve read a few books on JavaScript unit testing [1] and at least one other that was dedicated to Jasmine, [2] and this one is a strong entry.

If you’re unfamiliar with Jasmine, Ragonha will give you a solid foundation of the testing framework by the end of the second chapter. Less than 40 pages in and you’ll understand Jasmine’s approach to testing, as well as how to stand up a basic test suite. His coverage of the core functions and the collection of built-in matchers is concise and accurate. He builds on this foundation by demonstrating Jasmine’s abilities in testing everything from asynchronous code (Sinon.js!) to MVC components (Backbone.js!) to AMD modules (Require.js!).

Despite the title, Jasmine JavaScript Testing isn’t merely about the testing framework, or even just about testing. What Ragonha gives us is a book about how to write better code, using testability as the measurement of success. What is strongest about this book is how he uses a refactoring project as a frame-of-reference for telling the testability story. He’s not just talking about using Jasmine for writing tests; he’s talking about how to use it alongside the other tools and patterns that will make you a better front-end developer.

If you’re just getting started with testing JavaScript for the front-end, or if you want to see some good real-world examples, then I would definitely recommend this one.

Disclosure: I received an electronic copy of this book from the publisher in exchange for writing this review.

[1] There was Mark Ethan Trostler’s Testable JavaScript; and then there’s Nicholas Zakas’ Maintainable JavaScript which, while not technically about testing, has at least the one chapter about it.

[2] Here I refer to Evan Hahn’s JavaScript Testing with Jasmine -- not to confuse anyone over titles or anything.
Profile Image for Matt Riley.
3 reviews
February 4, 2014
This book is better than the O'Reilly title that covers Jasmine by providing more information on each aspect of the framework. The author demonstrates a clear and unmistakable understanding of the primary topic along with related secondary topics. The book does a good job incrementally building a simple application using Jasmine as the BDD framework and highlights supplemental libraries and tools that help in creating an ideal test environment.

For me, the Jasmine-specific chapters felt short and kept to a specific narrative. That's very good in terms of the sample application being built but more stand-alone examples for each core concept would have been good. When compared to the official documentation, the examples felt like they were taking a very specific approach to implementing Jasmine. That left me wondering, are the docs too simplistic or are the book samples too narrow?

As is the case with any programming book, the only way to really learn the topic is to use it building something real. This book may not throw you in the deep-end but it does more than just get your feet wet. At 146 pages it's a quick read and will point you in the right direction when getting started learning front-end BDD with Jasmine.
236 reviews7 followers
September 9, 2016
This book is great for starters of Jasmine and it talks about many aspects of writing JavaScript unit tests using Jasmine.

I would've expected a few more code samples, but the ones that are there are more like real-world examples.

The author also introduces a few other plug-ins and add-ons that will help you write better and cleaner tests. The chapter on Build automation was interesting as well and that level of automation is critical for most applications these days. This is a relatively small book, but definitely has a lot of information.
Profile Image for LAFK.
49 reviews
December 30, 2016
Returning from Security Case Study conference I read this in one sitting while riding Warszawa - Kraków train (a bit above 3 hours). This is a good tutorial book, it certainly nicely deepens documentation that Jasmine folks put online with text fixtures, AJAX tests, spies in Jasmine and BackBone app testing.

Overall good and quick read, with nice amount of code and walking readers through examples. Recommended for beginners especially, due to nice amount of explanations.
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.