What about my CI run? I need to make sure only tested code gets checked in. Oh boy. This can be very frustrating.
- Envjs - Simulated Browser environment
- PhantomJS - Headless Webkit browser
- QUnit - Unit Testing Framework
- JsTestDriver - Framework for Unit Tests
#So what to use now ?
So I started with JSTest Driver since it seems to be the one which has all the features I wanted.
##JS Test Driver
After some fiddeling around I got the Maven test to run. The last commit of the maven plugn was around August 2011.
To use the plugin configure it like this (full code in the example code on github).
What I do not like at the moment is the specification of the browser path. This might make it hard to run the same configuration on a local machine and in a ci build. Yes, I don’t want to go down the path of maven profiles.
Even with that you might have the issue of the port configuration. Two testruns at the same time and both starting the server on the same port calls fro trouble.
mvn test shows me something like:
[INFO] --- jstd-maven-plugin:126.96.36.199:test (run-tests) @ jstestdriver-demo ---
J S T E S T D R I V E R
Total 2 tests (Passed: 1; Fails: 1; Errors: 0) (1.00 ms)
Firefox 12.0 Mac OS: Run 2 tests (Passed: 1; Fails: 1; Errors 0) (1.00 ms)
Echo Test.testHello2 failed (0.00 ms): AssertError:
The full demo code is available on GitHub.
Any thoughts ?