QUnit TeamCity Driver
Adding QUnitTeamCityDriver to your project
Add QUnitTeamCityDriver to your project via NuGet which will add
PM> Install-Package QUnitTeamCityDriver
If you don't already have one, create a page called
Tests.htmto host your QUnit tests
Follow the instructions here: http://docs.jquery.com/Qunit#Using_QUnit
Tests.htm. It should be placed after the reference to the QUnit script.
This file does nothing if it is not run in the context of PhantomJS so your QUnit tests will continue to run unaffected in the browser.
Configuring your TeamCity Build
As both .js files are part of your solution, they should both arrive on your build server when the latest sources are fetched.
- Download PhantomJS (Static) and copy it out to your build server, to a known location, for example:
- Add a "Command Line" Build Step to your build in TeamCity which executes Tests.htm via PhantomJS
- When run in the context of PhantomJS QUnitTeamCityDriver.js subscribes the QUnit's callback functions and outputs the results to TeamCity.
- Tested against phantomjs-1.2.0-win32-static.zip (June 26 2011)