From 33427418763048dc77beb0ef3c06b77e1774f6d9 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 11 Mar 2014 02:30:49 -0400 Subject: [PATCH] JSHint QUnit helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Don’t redefine controller - Mark all functions as exported - Mark the QUnit asyncTest as a global function --- .jshintignore | 1 - test/javascripts/helpers/qunit_helpers.js | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.jshintignore b/.jshintignore index a69f6a1f5e..3d225717a0 100644 --- a/.jshintignore +++ b/.jshintignore @@ -10,6 +10,5 @@ public/javascripts/ spec/phantom_js/smoke_test.js test/javascripts/helpers/assertions.js test/javascripts/helpers/parse_html.js -test/javascripts/helpers/qunit_helpers.js test/javascripts/test_helper.js vendor/ diff --git a/test/javascripts/helpers/qunit_helpers.js b/test/javascripts/helpers/qunit_helpers.js index 79bccf3ac0..448adf8dff 100644 --- a/test/javascripts/helpers/qunit_helpers.js +++ b/test/javascripts/helpers/qunit_helpers.js @@ -1,3 +1,5 @@ +/* global asyncTest */ +/* exported integration, testController, controllerFor, asyncTestDiscourse, fixture */ function integration(name, lifecycle) { module("Integration: " + name, { setup: function() { @@ -27,7 +29,7 @@ function testController(klass, model) { } function controllerFor(controller, model) { - var controller = Discourse.__container__.lookup('controller:' + controller); + controller = Discourse.__container__.lookup('controller:' + controller); if (model) { controller.set('model', model ); } return controller; }