diff options
author | Timmy Willison <4timmywil@gmail.com> | 2017-12-11 12:39:11 -0500 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2018-01-08 11:24:45 -0500 |
commit | 909e0c99251ee56ec35db0e08d5b1e6219ac8fbc (patch) | |
tree | a09f8f80f9d0849086717c6f9e9b2d3e7145dec6 /test | |
parent | 775caebd617e91e697b3e41ae33d6877e63785aa (diff) | |
download | jquery-909e0c99251ee56ec35db0e08d5b1e6219ac8fbc.tar.gz jquery-909e0c99251ee56ec35db0e08d5b1e6219ac8fbc.zip |
Core: deprecate jQuery.now
Fixes gh-2959
Close gh-3884
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/animation.js | 2 | ||||
-rw-r--r-- | test/unit/core.js | 4 | ||||
-rw-r--r-- | test/unit/deprecated.js | 6 | ||||
-rw-r--r-- | test/unit/effects.js | 2 | ||||
-rw-r--r-- | test/unit/tween.js | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/test/unit/animation.js b/test/unit/animation.js index 3c5e711d7..dfa00ac8d 100644 --- a/test/unit/animation.js +++ b/test/unit/animation.js @@ -19,13 +19,11 @@ QUnit.module( "animation", { this._oldInterval = jQuery.fx.interval; jQuery.fx.step = {}; jQuery.fx.interval = 10; - jQuery.now = Date.now; jQuery.Animation.prefilters = [ defaultPrefilter ]; jQuery.Animation.tweeners = { "*": [ defaultTweener ] }; }, teardown: function() { this.sandbox.restore(); - jQuery.now = Date.now; jQuery.fx.stop(); jQuery.fx.interval = this._oldInterval; window.requestAnimationFrame = oldRaf; diff --git a/test/unit/core.js b/test/unit/core.js index 276830ace..6778b14e9 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -190,10 +190,10 @@ QUnit.test( "globalEval execution after script injection (#7862)", function( ass script.src = baseURL + "mock.php?action=wait&wait=2&script=1"; - now = jQuery.now(); + now = Date.now(); document.body.appendChild( script ); - jQuery.globalEval( "var strictEvalTest = " + jQuery.now() + ";" ); + jQuery.globalEval( "var strictEvalTest = " + Date.now() + ";" ); assert.ok( window.strictEvalTest - now < 500, "Code executed synchronously" ); } ); diff --git a/test/unit/deprecated.js b/test/unit/deprecated.js index 6e44b3a45..962cad4fa 100644 --- a/test/unit/deprecated.js +++ b/test/unit/deprecated.js @@ -202,3 +202,9 @@ QUnit.test( "jQuery.camelCase()", function( assert ) { assert.equal( jQuery.camelCase( key ), val, "Converts: " + key + " => " + val ); } ); } ); + +QUnit.test( "jQuery.now", function( assert ) { + assert.expect( 1 ); + + assert.ok( typeof jQuery.now() === "number", "jQuery.now is a function" ); +} ); diff --git a/test/unit/effects.js b/test/unit/effects.js index c5f8d53c3..d023dc8c1 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -19,11 +19,9 @@ QUnit.module( "effects", { this._oldInterval = jQuery.fx.interval; jQuery.fx.step = {}; jQuery.fx.interval = 10; - jQuery.now = Date.now; }, teardown: function() { this.sandbox.restore(); - jQuery.now = Date.now; jQuery.fx.stop(); jQuery.fx.interval = this._oldInterval; window.requestAnimationFrame = oldRaf; diff --git a/test/unit/tween.js b/test/unit/tween.js index 28fcfad25..5d3d49d18 100644 --- a/test/unit/tween.js +++ b/test/unit/tween.js @@ -15,11 +15,9 @@ QUnit.module( "tween", { this._oldInterval = jQuery.fx.interval; jQuery.fx.step = {}; jQuery.fx.interval = 10; - jQuery.now = Date.now; }, teardown: function() { this.sandbox.restore(); - jQuery.now = Date.now; jQuery.fx.stop(); jQuery.fx.interval = this._oldInterval; window.requestAnimationFrame = oldRaf; |