Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.36 KB

README.md

File metadata and controls

46 lines (30 loc) · 1.36 KB

QUnit Phing Task

This project is a Phing build tool task for running QUnit tests headless with PhantomJS

Requirements

This project has been tested with

Example

To use this task, add the classpath where you placed the QunitTask.php in your build.xml file:

<path id="project.class.path">
	<pathelement dir="dir/to/qunittaskfile/"/>
</path>

Then include it with a taskdef tag in your build.xml file:

<taskdef name="qunit" classname="QunitTask">
	<classpath refid="project.class.path"/>
</taskdef>

You can now use the task

<target name="qunit" description="Javascript Unit Test">
	<qunit executable="DISPLAY=:0 /path/to/phantomjs" haltonfailure="true" runner="${basedir}/tests/run-qunit.js">
		<fileset dir="${basedir}">
			<include name="tests/runner.html" />
		</fileset>
	</qunit>
</target>

Task Attributes

Required

There are no required attributes.

Optional

  • runner - Specifies the qunit runner, look at run-qunit-example.js
  • executable - Path to phantomjs command.
  • haltonfailure - If the build should fail if any test fails.