Tests: Clear the timers queue in an animateClass test

jQueries older than 1.11 or 2.1 were leaving a timer in the queue which could
then influence other tests.

Closes gh-1926
This commit is contained in:
Michał Gołębiowski-Owczarek 2020-07-23 15:49:27 +02:00 committed by GitHub
parent b61b16b5a8
commit 42bcdb90f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,12 +146,9 @@ QUnit.test( "animateClass works with colors", function( assert ) {
QUnit.test( "animateClass calls step option", function( assert ) { QUnit.test( "animateClass calls step option", function( assert ) {
assert.expect( 1 ); assert.expect( 1 );
var ready = assert.async();
var test = jQuery( "div.animateClass" ), var test = jQuery( "div.animateClass" ),
step = function() { step = function() {
assert.ok( true, "Step Function Called" ); assert.ok( true, "Step Function Called" );
test.stop();
ready();
step = $.noop; step = $.noop;
}; };
test.toggleClass( "testChangeBackground", { test.toggleClass( "testChangeBackground", {
@ -159,6 +156,8 @@ QUnit.test( "animateClass calls step option", function( assert ) {
step(); step();
} }
} ); } );
test.stop( true, true );
} ); } );
QUnit.test( "animateClass works with children", function( assert ) { QUnit.test( "animateClass works with children", function( assert ) {