aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2016-08-30 16:26:18 -0400
committerScott González <scott.gonzalez@gmail.com>2016-08-30 16:37:24 -0400
commit3a45a47968c8b45646bfc273bd257596212856a1 (patch)
treed13f6f1ce68285e5ec49fa646ae130ec62032cba
parentd7ea031bd361d67617a02505e294e7e8cd8a8915 (diff)
downloadjquery-ui-3a45a47968c8b45646bfc273bd257596212856a1.tar.gz
jquery-ui-3a45a47968c8b45646bfc273bd257596212856a1.zip
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
-rw-r--r--tests/unit/effects/core.js4
1 files 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();
};
}