diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 27eea1c81..a1c545a6f 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -1710,6 +1710,18 @@ function test_focusout() { }); } +function test_easing() { + var easing = jQuery.easing, + easing_fns = ["linear", "swing"], + step = Math.pow( 2, -3 ); // use power of 2 to prevent floating point rounding error + easing_fns.forEach( function( name ) { + var fn = easing[ name ]; + for( var i = 0; i <= 1; i += step ) { + console.log( "$.easing." + name + "(" + i + "): " + fn.call(easing, i) ); + } + } ); +} + function test_fx() { jQuery.fx.interval = 100; $("input").click(function () { diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index bc84cb475..56a371f99 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1818,3 +1818,24 @@ function test_widget() { $(".selector").jQuery.Widget("option", "disabled", true); $(".selector").jQuery.Widget("option", { disabled: true }); } + +function test_easing() { + var easing = jQuery.easing, + easing_fns = ["easeInQuad", "easeOutQuad", "easeInOutQuad", + "easeInCubic", "easeOutCubic", "easeInOutCubic", + "easeInQuart", "easeOutQuart", "easeInOutQuart", + "easeInQuint", "easeOutQuint", "easeInOutQuint", + "easeInExpo", "easeOutExpo", "easeInOutExpo", + "easeInSine", "easeOutSine", "easeInOutSine", + "easeInCirc", "easeOutCirc", "easeInOutCirc", + "easeInElastic", "easeOutElastic", "easeInOutElastic", + "easeInBack", "easeOutBack", "easeInOutBack", + "easeInBounce", "easeOutBounce", "easeInOutBounce"], + step = Math.pow( 2, -3 ); // use power of 2 to prevent floating point rounding error + easing_fns.forEach( function( name ) { + var fn = easing[ name ]; + for( var i = 0; i <= 1; i += step ) { + console.log( "$.easing." + name + "(" + i + "): " + fn.call(easing, i) ); + } + } ); +}