FIX qunit test runner for phantomjs 2.0

This commit is contained in:
Régis Hanol
2015-08-25 10:42:19 +02:00
parent 124fc4daf7
commit 294669c856
5 changed files with 31 additions and 23 deletions

View File

@@ -2,13 +2,17 @@
/*global QUnit, ANSI */
// THIS FILE IS CALLED BY "qunit_runner.rb" IN AUTOSPEC
if (phantom.args.length !== 1) {
var system = require('system'),
args = system.args;
args.shift();
if (args.length !== 1) {
console.log("Usage: " + phantom.scriptName + " <URL>");
phantom.exit(1);
}
var system = require('system'),
fs = require('fs'),
var fs = require('fs'),
page = require('webpage').create(),
QUNIT_RESULT = "./tmp/qunit_result";
@@ -34,7 +38,7 @@ page.start = new Date();
// -----------------------------------WARNING --------------------------------------
// calling "console.log" BELOW this line will go through the "page.onConsoleMessage"
// -----------------------------------WARNING --------------------------------------
page.open(phantom.args[0], function (status) {
page.open(args[0], function (status) {
if (status !== "success") {
console.log("\nNO NETWORK :(\n");
phantom.exit(1);