Skip to content

Commit 3a45a47

Browse files
committed
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
1 parent d7ea031 commit 3a45a47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/unit/effects/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QUnit.assert.notPresent = function( value, array, message ) {
2929
};
3030

3131
// MinDuration is used for "short" animate tests where we are only concerned about the final
32-
var minDuration = 15,
32+
var minDuration = 60,
3333

3434
// Duration is used for "long" animates where we plan on testing properties during animation
3535
duration = 200;
@@ -332,7 +332,7 @@ $.each( $.effects.effect, function( effect ) {
332332

333333
function duringTest( fn ) {
334334
return function( next ) {
335-
setTimeout( fn );
335+
setTimeout( fn, minDuration / 2 );
336336
next();
337337
};
338338
}

0 commit comments

Comments
 (0)