Skip to content

Commit f0432d5

Browse files
committed
This should repair the unit
1 parent 81432c8 commit f0432d5

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

test/unit/effects.js

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,29 +1405,27 @@ asyncTest( "jQuery.Animation( object, props, opts )", 4, function() {
14051405

14061406
asyncTest( "Animate Option: step: function( percent, tween )", 1, function() {
14071407
var counter = {};
1408-
// if the animation loop is already running when we start this test, it WILL fail
1409-
// going to try delaying 100ms to make sure any potential leftover animations are done
1410-
setTimeout( function() {
1411-
jQuery( "#foo" ).animate({
1412-
prop1: 1,
1413-
prop2: 2,
1414-
prop3: 3
1415-
}, {
1416-
duration: 1,
1417-
step: function( value, tween ) {
1418-
var calls = counter[ tween.prop ] = counter[ tween.prop ] || [];
1419-
calls.push( value );
1420-
}
1421-
}).queue( function( next ) {
1422-
deepEqual( counter, {
1423-
prop1: [0, 1],
1424-
prop2: [0, 2],
1425-
prop3: [0, 3]
1426-
}, "Step function was called once at 0% and once at 100% for each property");
1427-
next();
1428-
start();
1429-
});
1430-
}, 100 );
1408+
jQuery( "#foo" ).animate({
1409+
prop1: 1,
1410+
prop2: 2,
1411+
prop3: 3
1412+
}, {
1413+
duration: 1,
1414+
step: function( value, tween ) {
1415+
var calls = counter[ tween.prop ] = counter[ tween.prop ] || [];
1416+
// in case this is called multiple times for either, lets store it in
1417+
// 0 or 1 in the array
1418+
calls[ value === 0 ? 0 : 1 ] = value;
1419+
}
1420+
}).queue( function( next ) {
1421+
deepEqual( counter, {
1422+
prop1: [0, 1],
1423+
prop2: [0, 2],
1424+
prop3: [0, 3]
1425+
}, "Step function was called once at 0% and once at 100% for each property");
1426+
next();
1427+
start();
1428+
});
14311429
});
14321430

14331431
asyncTest( "Animate callbacks have correct context", 2, function() {

0 commit comments

Comments
 (0)