From 8c3921002d50cfcd42f920ed38b89ac2f0483c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 30 Aug 2016 16:26:18 -0400 Subject: [PATCH] Effects: Adjust animation duration in tests With jQuery 3 using `requestAnimationFrame()`, the `setTimeout()` timing for short animations wasn't working consistently. This resulted in infrequent failures everywhere (but infrequent enough that it's hard to even notice), but consistent failures in IE and Edge. Bumping up the duration and running the assertions in the middle seems to give consistent results. Eventually, we should refactor this to use `requestAnimationFrame()` in the tests themselves to avoid problems like this. --- tests/unit/effects/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/effects/core.js b/tests/unit/effects/core.js index 0812e118404..9863cd8ca81 100644 --- a/tests/unit/effects/core.js +++ b/tests/unit/effects/core.js @@ -29,7 +29,7 @@ QUnit.assert.notPresent = function( value, array, message ) { }; // MinDuration is used for "short" animate tests where we are only concerned about the final -var minDuration = 15, +var minDuration = 60, // Duration is used for "long" animates where we plan on testing properties during animation duration = 200; @@ -332,7 +332,7 @@ $.each( $.effects.effect, function( effect ) { function duringTest( fn ) { return function( next ) { - setTimeout( fn ); + setTimeout( fn, minDuration / 2 ); next(); }; }