From: Wolfram Schneider Date: Mon, 3 Feb 2014 11:49:44 +0000 (+0100) Subject: indent phandom files X-Git-Tag: 1.0.0~1537^2~2 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=2b7e272dc1072cf1cb80769f40a5cbbb16c30f03 indent phandom files --- diff --git a/test/Makefile b/test/Makefile index b1e02f9..785017a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -32,7 +32,7 @@ phantomjs: ${PHANTOMJS} phantom/evaluate.js ${PHANTOMJS_URL} ${PHANTOMJS_TIMEOUT} jsbeautifier jsb indent: - for i in ./spec*/*.js ./js/*.js; do \ + for i in ./spec*/*.js ./js/*.js ./phantom/*.js; do \ jsbeautifier -j $$i > $@.tmp && mv -f $@.tmp $$i; \ done diff --git a/test/phantom/evaluate.js b/test/phantom/evaluate.js index db00c4b..bb6a537 100644 --- a/test/phantom/evaluate.js +++ b/test/phantom/evaluate.js @@ -20,8 +20,8 @@ page.viewportSize = { }; var run_time = 8; // poll up to seconds -if (system.args[2] && parseFloat(system.args[2]) > 0){ - run_time = parseFloat(system.args[2] ); +if (system.args[2] && parseFloat(system.args[2]) > 0) { + run_time = parseFloat(system.args[2]); } /************************/ @@ -29,10 +29,9 @@ if (system.args[2] && parseFloat(system.args[2]) > 0){ function wait_for_jasmine(checkFx, readyFx, failFx, timeout) { var max_timeout = timeout ? timeout : run_time * 1000, start = new Date().getTime(), - result, - condition = false; + result, condition = false; - var interval = setInterval(function() { + var interval = setInterval(function () { console.log("."); // success @@ -45,7 +44,7 @@ function wait_for_jasmine(checkFx, readyFx, failFx, timeout) { } // timeout - else if ( new Date().getTime() - start >= max_timeout ) { + else if (new Date().getTime() - start >= max_timeout) { result.time = (new Date().getTime() - start); failFx(result); phantom.exit(1); @@ -54,8 +53,7 @@ function wait_for_jasmine(checkFx, readyFx, failFx, timeout) { // checking else { result = checkFx(); - if (result) - condition = result.mkws.jasmine_done; + if (result) condition = result.mkws.jasmine_done; } }, 500); //< repeat check every N ms @@ -84,26 +82,26 @@ page.open(url, function (status) { passing: window.$(".passingAlert").text() }; } - })}, - - function(result) { - console.log("MKWS tests are successfully done in " + result.time/1000 + " seconds. Hooray!"); - console.log("jasmine duration: " + result.duration); - console.log("jasmine passing: " + result.passing); - }, - - function (result) { - var error_png = "./mkws-error.png"; - var error_html = "./mkws-error.html"; - - console.log("MKWS tests failed after " + result.time/1000 + " seconds"); - console.log("keep screenshot in '" + error_png + "'"); - page.render(error_png); - - console.log("keep html DOM in '" + error_html + "'"); - var html = result.html + "\n\n\n"; - var fs = require('fs'); - fs.write(error_html, html, "wb"); - }, - run_time * 1000); + }) + }, + + function (result) { + console.log("MKWS tests are successfully done in " + result.time / 1000 + " seconds. Hooray!"); + console.log("jasmine duration: " + result.duration); + console.log("jasmine passing: " + result.passing); + }, + + function (result) { + var error_png = "./mkws-error.png"; + var error_html = "./mkws-error.html"; + + console.log("MKWS tests failed after " + result.time / 1000 + " seconds"); + console.log("keep screenshot in '" + error_png + "'"); + page.render(error_png); + + console.log("keep html DOM in '" + error_html + "'"); + var html = result.html + "\n\n\n"; + var fs = require('fs'); + fs.write(error_html, html, "wb"); + }, run_time * 1000); });