- Running asynchronous QUnit tests from Ant in PhantomJS
- var page = require("webpage").create();
- page.onConsoleMessage = function(msg) {
- if(msg.indexOf("FINISHED") > -1) {
- var failed = msg.split(" ");
- phantom.exit(failed[1]);
- }
- };
- page.open("testrunner.html", function() {
- page.evaluate(function() {
- QUnit.done = function(result) {
- console.log("FINISHED " + result.failed);
- };
- });
- });