From 3782fbed2b817eab148c29592823ec7c8bdccb3e Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 11 Mar 2014 03:10:55 -0400 Subject: [PATCH] JSHint run-qunit.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Turn on devel for console and phantom for the phantomjs globals - Remove unnecessary semicolons - Use strict comparisons - Add missing var statements used by for…in --- .jshintignore | 1 - lib/autospec/run-qunit.js | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.jshintignore b/.jshintignore index 26a6c2b7f..3b28be886 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,5 +1,4 @@ app/assets/javascripts/defer/html-sanitizer-bundle.js -lib/autospec/run-qunit.js lib/headless-ember.js lib/javascripts/locale/ lib/javascripts/messageformat.js diff --git a/lib/autospec/run-qunit.js b/lib/autospec/run-qunit.js index 15804f269..59d152458 100644 --- a/lib/autospec/run-qunit.js +++ b/lib/autospec/run-qunit.js @@ -1,6 +1,8 @@ +/*jshint devel:true, phantom:true */ +/*global QUnit, ANSI */ // THIS FILE IS CALLED BY "qunit_runner.rb" IN AUTOSPEC -if (phantom.args.length != 1) { +if (phantom.args.length !== 1) { console.log("Usage: " + phantom.scriptName + " "); phantom.exit(1); } @@ -95,7 +97,7 @@ function colorizer() { return colorCode + text + colorEnd; } }; -}; +} function logQUnit() { @@ -144,10 +146,10 @@ function logQUnit() { // display failures if (Object.keys(errors).length > 0) { console.log("Failures:\n"); - for (m in errors) { + for (var m in errors) { var module = errors[m]; console.log("Module Failed: " + ANSI.highlight(m, "red")); - for (t in module) { + for (var t in module) { var test = module[t]; console.log(" Test Failed: " + t); for (var a = 0; a < test.length; a++) { @@ -172,4 +174,4 @@ function logQUnit() { window.qunitResult = context; }); -}; +}