(bug 37390) Clean up QUnit test suites
authorTimo Tijhof <ttijhof@wikimedia.org>
Mon, 30 Jul 2012 23:46:50 +0000 (16:46 -0700)
committerTimo Tijhof <ttijhof@wikimedia.org>
Mon, 30 Jul 2012 23:46:50 +0000 (16:46 -0700)
commit00af396ea7faef14d9765b0ab09a07a33845c52f
tree2cadadffed7b970466f63b055e5d2df55824828d
parent0c1471c59413225ae331256a3e952ad244f15536
(bug 37390) Clean up QUnit test suites

* Use new QUnit 1.8.0+ pattern:
 - no-globals (only QUnit itself)
 - assert-object pattern
 - Remove pointless '-- Initial check' assertions.
   I introduced this pattern last year for no particular reason and
   everybody just copied it. There is no reason for it, it works fine
   without it. And the rest of the world that uses QUnit doesn't do
   it either. Exceptions are caught by QUnit and error handling there
   is much better than a dull '!ok()' assertion.

* .jshintrc:
 - Tolerate "mulistr" (this is used in many extensions, test suites
   as well as in MediaWiki core)
   "foo\
   bar"
 - Use "jquery: true" instead of "jQuery" so that JSHint can optimize
   for jQuery edge cases.

Misc issues fixed:
 * Trailing comma's in jquery.tablesorter.test
 * Missing semi-colon in testrunner.js
 * Remove backwards-compatible line for "equals()" and "same()".
   These have been deprecated in QUnit since 2009 (which is way
   before we even started looking at QUnit).
   Inside QUnit itself is a deprecation notice, I don't know why
   I added this compatibility line, it is stupid and overrides the
   nice deprecation-warning that QUnit has built in for it).
 * Use QUnit.push inside assertTrue and assertFalse.
   QUnit assertion methods must not call each other, in order to keep
   the call stack length as expected so that QUnit can report the
   file and line number of the caller of the assertion in case of
   failure etc.

Change-Id: I5cded6e8c32dba39170a02bdd3236c8b7b04d269
25 files changed:
.jshintrc
tests/qunit/data/qunitOkCall.js
tests/qunit/data/testrunner.js
tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js
tests/qunit/suites/resources/jquery/jquery.byteLength.test.js
tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js
tests/qunit/suites/resources/jquery/jquery.client.test.js
tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js
tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js
tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js
tests/qunit/suites/resources/jquery/jquery.highlightText.test.js
tests/qunit/suites/resources/jquery/jquery.localize.test.js
tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js
tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js
tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
tests/qunit/suites/resources/jquery/jquery.textSelection.test.js
tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js
tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js