Skip to content

Commit

Permalink
Effects: fix failing tests in IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Jul 8, 2015
1 parent 7ee0fea commit fe6afa8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions test/unit/animation.js
Expand Up @@ -17,15 +17,16 @@ module( "animation", {
this.sandbox = sinon.sandbox.create();
this.clock = this.sandbox.useFakeTimers( startTime );
this._oldInterval = jQuery.fx.interval;
this._oldNow = jQuery.now;
jQuery.fx.step = {};
jQuery.fx.interval = 10;
jQuery.now = Date.now;
jQuery.now = Date.now || this._oldNow;
jQuery.Animation.prefilters = [ defaultPrefilter ];
jQuery.Animation.tweeners = { "*": [ defaultTweener ] };
},
teardown: function() {
this.sandbox.restore();
jQuery.now = Date.now;
jQuery.now = this._oldNow;
jQuery.fx.stop();
jQuery.fx.interval = this._oldInterval;
window.requestAnimationFrame = oldRaf;
Expand Down
7 changes: 4 additions & 3 deletions test/unit/tween.js
Expand Up @@ -13,13 +13,14 @@ module( "tween", {
this.sandbox = sinon.sandbox.create();
this.clock = this.sandbox.useFakeTimers( 505877050 );
this._oldInterval = jQuery.fx.interval;
this._oldNow = jQuery.now;
jQuery.fx.step = {};
jQuery.fx.interval = 10;
jQuery.now = Date.now;
jQuery.now = Date.now || this._oldNow;
},
teardown: function() {
this.sandbox.restore();
jQuery.now = Date.now;
jQuery.now = this._oldNow;
jQuery.fx.stop();
jQuery.fx.interval = this._oldInterval;
window.requestAnimationFrame = oldRaf;
Expand Down Expand Up @@ -198,7 +199,7 @@ test( "jQuery.Tween - Element", function() {

ok( easingSpy.calledWith( 0.1, 0.1 * testOptions.duration, 0, 1, testOptions.duration ),
"...using jQuery.easing.linear with back-compat arguments" );
equal( parseFloat( testElement.style.height ).toFixed( 2 ), eased.toFixed( 2 ), "Set value" );
equal( Math.floor( parseFloat( testElement.style.height ) ), Math.floor( eased ), "Set value" );

tween.run( 1 );
equal( testElement.style.height, "0px", "Checking another value" );
Expand Down

0 comments on commit fe6afa8

Please sign in to comment.