From 3a45a47968c8b45646bfc273bd257596212856a1 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 30 Aug 2016 16:26:18 -0400 Subject: 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. Closes gh-1738 --- 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 0812e1184..9863cd8ca 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(); }; } -- cgit v1.2.3