Skip to content

Commit b0d65f7

Browse files
committed
Effects: Account for pre-jQuery-3.2.0 bugs
Followup to #264 See jquery/jquery@6d43dc4
1 parent 05c2398 commit b0d65f7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/effects.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ QUnit.test( "jQuery.easing", function( assert ) {
55
easingCallCount = 0,
66
animComplete = assert.async();
77

8-
assert.expect( 4 );
8+
assert.expect( 5 );
99

1010
jQuery.easing.testOld = function( p, n, firstNum, diff ) {
1111
assert.ok( false, "should not have been called" );
1212
};
1313

1414
jQuery.easing.testNew = function( p ) {
15-
if ( ++easingCallCount < 3 ) {
16-
assert.ok( p > lastP, "called, percentage is increasing" );
17-
lastP = p;
15+
if ( ++easingCallCount < 4 ) {
16+
if ( p === 0 && p === lastP ) {
17+
assert.ok( true, "p===0 called twice before jQuery 3.2.0" );
18+
} else {
19+
assert.ok( p > lastP, "called, percentage is increasing" );
20+
lastP = p;
21+
}
1822
}
1923

2024
// Linear

0 commit comments

Comments
 (0)