O'Reilly logo

PhantomJS Cookbook by Rob Friesel

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

Using TerminalReporter for unit testing in PhantomJS

This recipe introduces the jasmine-reporters library, and it explains how to use TerminalReporter for clear and concise output on the command line when using PhantomJS.

Getting ready

To run this recipe, we will need the following items:

  • JavaScript code to test, and the tests for that code
  • The Jasmine testing framework
  • The jasmine-reporters library

Note

The jasmine-reporters library is a collection of advanced reporters for the Jasmine test framework. It is an open source (MIT licensed) project and is available at https://github.com/larrymyers/jasmine-reporters.

The library code that we will use for our tests is available in the downloadable code repository as string-utils.js under lib; the accompanying ...

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