Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Drive CasperJS from Node.js
JavaScript
tag: v0.1.2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
tests
LICENSE
Makefile
README.md
package.json

README.md

SpookyJS

Drive CasperJS from Node.js.

Installation

Prerequisites

SpookyJS is available from npm.

$ npm install spooky

Usage

var Spooky = require('spooky');

var spooky = new Spooky(null, function (err, error, response) {
        var e;
        if (err || error) {
            e = new Error('Failed to initialize SpookyJS');
            e.details = err || error;
            throw e;
        }

        spooky.on('error', function (e) {
            console.error(e);
        });

        spooky.on('console', function (line) {
            console.log(line);
        });

        spooky.start();
        spooky.then(function () {
            this.echo('Hello, SpookyJS');
        });
        spooky.run();
    });

A minimal example can be found in examples.

$ node examples/hello.js

See tests/util/hooks.js for an example of how to use SpookyJS with Mocha.

See tests/features/ for an example using SpookyJS with Cucumber.js.

Development

Running the tests

SpookyJS includes a suite of unit tests, driven by Mocha. To run the tests:

$ make test

The following parameters are supported (defaults are in parentheses):

  • TEST_REPORTER the Mocha reporter to use (dot)
  • TEST_PORT the port to run the fixture web server on (8080)
  • TEST_TIMEOUT threshold in ms to timeout a test (4000)
  • TEST_SLOW threshold in ms to say a test is slow (2000)
  • TEST_ARGS Additional arguments to pass through to Mocha

License

SpookyJS is made available under the MIT License.

Acknowledgements and Attribution

The image tests/fixtures/fail-road.jpeg is the work Fail Road and is copyright (c) 2007 fireflythegreat and made available under an Attribution 2.0 Generic license.

Something went wrong with that request. Please try again.