O'Reilly logo

PhoneGap By Example by Andrey Kovalenko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing with Jasmine and headless browser PhantomJS

In the following section, we will look at BDD tests implementation with Jasmine and PhantomJS, using the example of the Imaginary application we built in Chapter 8, Building "Imaginary" – An Application with Instagram-like Image Filters.

Introduction to the Jasmine

Jasmine is available as a Node.js module and also as a library that we could use in the browser. It comes with its assertion methods.

It's a module, so it could be installed via the Node.js package manager, npm:

$ npm install jasmine-node -g

The command sets up Jasmine globally, so we can run jasmine-node in every directory of our choice. The tests could be organized into different files placed in one folder or subfolders. The only requirement ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required