Tests: further improvements QUnit 2.0 migration

* Remove QUnit jshint globals
* Extend QUnit.assert methods
* Use assert.async instead of start/stop/done

Ref b930d14ce6
This commit is contained in:
Oleg Gaidarenko
2015-09-08 03:26:29 +03:00
parent 3dd3d1357d
commit c8d15a2f9f
16 changed files with 284 additions and 262 deletions

View File

@@ -38,7 +38,7 @@ this.q = function() {
* @example t("Check for something", "//[a]", ["foo", "baar"]);
* @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar'
*/
this.t = function( a, b, c ) {
QUnit.assert.t = function( a, b, c ) {
var f = jQuery( b ).get(),
s = "",
i = 0;
@@ -47,7 +47,7 @@ this.t = function( a, b, c ) {
s += ( s && "," ) + '"' + f[ i ].id + '"';
}
deepEqual( f, q.apply( q, c ), a + " (" + b + ")" );
this.deepEqual( f, q.apply( q, c ), a + " (" + b + ")" );
};
this.createDashboardXML = function() {
@@ -199,7 +199,7 @@ this.ajaxTest = function( title, expect, options ) {
if ( !completed ) {
completed = true;
delete ajaxTest.abort;
ok( false, "aborted " + reason );
assert.ok( false, "aborted " + reason );
jQuery.each( requests, function( i, request ) {
request.abort();
} );