Skip to content

Instantly share code, notes, and snippets.

@mallim
mallim / unit.js
Last active December 18, 2015 21:48 — forked from trek/unit.js
This code has been tested to work with casperjs 1.0.2 and phantomjs 1.9.1. After writing this, then I managed to get mocha-phantomjs (https://github.com/metaskills/mocha-phantomjs) to work and I switch to that. Primarily because mocha-phantomjs allows the usage of mocha's reporter straight without further customization. Additional things feature…
// Check for phantom
if ( !phantom.casperLoaded ) {
console.log( 'This script must be invoked using the casperjs executable' );
phantom.exit( 1 );
}
// get a Casper object.
// See http://casperjs.org/
// Instantiate casper
var casper = require('casper').create({