QUnit PhantomJS Runner

2.4.2 · abandoned · verified Sun Apr 19

qunit-phantomjs-runner is a command-line utility designed to execute QUnit test suites headlessly using the PhantomJS browser engine. As of version 2.4.2, it provides basic console output for test results. The package's development largely coincided with the active period of PhantomJS, which has since been deprecated. Its primary mode of operation involves invoking a PhantomJS executable with the runner script and a URL to a QUnit test page. This approach offered a lightweight alternative to more complex test setup tools like Grunt in its era, although newer solutions often leverage modern headless browsers like Chrome or Firefox. The project appears to be in an abandoned state, given the general deprecation of PhantomJS and the age of its latest releases (last published to npm 5 years ago, GitHub shows last commit 10 years ago for `node-qunit-phantomjs` which uses this, but no direct releases for `qunit-phantomjs-runner` on GitHub).

Common errors

Warnings

Install

Quickstart

Demonstrates how to install the package and run QUnit tests headlessly using the PhantomJS executable, including options for timeout and viewport size.

# First, ensure PhantomJS is installed and available in your system's PATH.
# You can often install it globally via npm (though it's deprecated):
# npm install -g phantomjs-prebuilt

# Then, install the runner locally:
npm install qunit-phantomjs-runner

# Create a simple QUnit test file, e.g., tests.html
# (Make sure QUnit is included in tests.html)

# To run your QUnit tests headlessly:
phantomjs node_modules/qunit-phantomjs-runner/runner.js http://localhost:8000/tests.html

# Example with a custom timeout (5 seconds) and viewport size:
# phantomjs node_modules/qunit-phantomjs-runner/runner.js http://localhost:8000/tests.html 5 '{"viewportSize":{"width":1000,"height":1000}}'

view raw JSON →