My name is Ido Goren and I’m a member in the River development team.
In short, QUnit provides a set of assertion functions, that when run from within a test can cause the test to fail. To run your tests, you write a very simple HTML file that when opened in a browser window, launches the tests and displays their results.
In order to ensure the quality of our product, I wanted to run our unit tests as part of our central build process (a Jenkins job running on a Linux machine in Germany) that is triggered every time a developer submits code to our source control (git in our case). However, running QUnit tests requires a browser, which is quite challenging for a central build machine that runs headlessly (meaning with no user interface). It would require us to configure the Linux machine to run X Window System, but we have no control over that machine…
<path to your PhantomJS exe file>/phantomjs.exe <your runner file> <your html test file>
You could even pipe the result to an xml file that’s compatible with the JUnit test output format.
In the process of adapting our code to run using PhantomJS, I found it useful to separate testing logic from the test HTML file.
Therefore, my final challenge was finding a Maven plugin that could run PhantomJS. I used our internal Nexus server to find the the phantomjs-maven Maven plugin.
I hope you’ll find this information useful and any feedback will be more than welcome!