By default, wallaby.js ships with and uses PhantomJs version 2.1.1. If you would like to use another PhantomJs, you may use env.runner setting to specify the path to it.

Relative path is supported, so if you have a NPM module that installs platform-specific PhantomJs version, for example phantomjs-prebuilt), you may just reference PhantomsJs 2 like so:

npm install phantomjs-prebuilt --save-dev

+

module.exports = function () {
  return {
    files: [
      ...
    ],

    tests: [
      ...
    ],

    env: {
      runner: require('phantomjs-prebuilt').path
    }
  };
};

You may also use absolute path or even just phantomjs if you have it in PATH:

module.exports = function () {
  return {
    files: [
      'lib/**/*.js'
    ],

    tests: [
      'test/**/*Spec.js'
    ],

    env: {
      type: 'browser',
      runner: '/Users/user/Downloads/phantomjs-2.1.1-macosx/bin/phantomjs'
      // or
      // runner: 'C:\\Tmp\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe'
      // or (if you have phantomjs 2 path set in your system environment) just
      // runner: 'phantomjs'
    }
  };
};

PhantomJs 1.9.8

Previously wallaby.js was using PhantomJs 1.9.8. If you would like to switch back to this version, you may do this:

 npm install [email protected] --save-dev

+

 module.exports = function () {
   return {
     files: [
       ...
     ],

     tests: [
       ...
     ],

     env: {
       runner: require('phantomjs').path
     }
   };
 };

Or, if you have PhantomJs 1.9.8 path set in your system environment, you may just do:

 module.exports = function () {
   return {
     files: [
       ...
     ],

     tests: [
       ...
     ],

     env: {
       runner: 'phantomjs'
     }
   };
 };

You may also specify a relative or absolute path to the PhantomJs 1.9.8 executable.

Passing PhantomJs params

You may pass PhantomJs params, for example --local-to-remote-url-access=true, via env.params.runner.