aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/effects.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywil@users.noreply.github.com>2023-09-18 12:39:00 -0400
committerGitHub <noreply@github.com>2023-09-18 12:39:00 -0400
commit2bdecf8b7bd10864e5337a4e24e39476c78cf23a (patch)
tree4685fc5ca912e368c294a3949c7ef5b663fec980 /test/unit/effects.js
parentf75daab09102a4dd5107deadb55d4a169f86254a (diff)
downloadjquery-2bdecf8b7bd10864e5337a4e24e39476c78cf23a.tar.gz
jquery-2bdecf8b7bd10864e5337a4e24e39476c78cf23a.zip
Build: migrate most grunt tasks off of grunt
Updated tasks include: - lint - npmcopy - build, minify, and process for distribution. - new custom build command using yargs - compare size of minified/gzip built files - pretest scripts, including qunit-fixture, babel transpilation, and npmcopy - node smoke tests - promises aplus tests - new watch task using `rollup.watch` directly Also: - upgraded husky and added the new lint command - updated lint config to use new "flat" config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new - Temporarily disabled one lint rule until flat config is supported by eslint-plugin-import. See https://github.com/import-js/eslint-plugin-import/issues/2556 - committed package-lock.json - updated all test scripts to use the new build - added an express test server that uses middleware-mockserver (this can be used to run tests without karma) - build-all-variants is now build:all Close gh-5318
Diffstat (limited to 'test/unit/effects.js')
-rw-r--r--test/unit/effects.js62
1 files changed, 44 insertions, 18 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js
index b3c86c382..8f6492124 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -8,8 +8,12 @@ if ( !includesModule( "effects" ) ) {
var fxInterval = 13,
oldRaf = window.requestAnimationFrame,
hideOptions = {
- inline: function() { jQuery.style( this, "display", "none" ); },
- cascade: function() { this.className = "hidden"; }
+ inline: function() {
+ jQuery.style( this, "display", "none" );
+ },
+ cascade: function() {
+ this.className = "hidden";
+ }
};
QUnit.module( "effects", {
@@ -540,12 +544,12 @@ QUnit.test( "animate duration 0", function( assert ) {
assert.expect( 11 );
var $elem,
- $elems = jQuery( [ { a:0 }, { a:0 } ] ),
+ $elems = jQuery( [ { a: 0 }, { a: 0 } ] ),
counter = 0;
assert.equal( jQuery.timers.length, 0, "Make sure no animation was running from another test" );
- $elems.eq( 0 ).animate( { a:1 }, 0, function() {
+ $elems.eq( 0 ).animate( { a: 1 }, 0, function() {
assert.ok( true, "Animate a simple property." );
counter++;
} );
@@ -555,18 +559,18 @@ QUnit.test( "animate duration 0", function( assert ) {
assert.equal( counter, 1, "One synchronic animations" );
- $elems.animate( { a:2 }, 0, function() {
+ $elems.animate( { a: 2 }, 0, function() {
assert.ok( true, "Animate a second simple property." );
counter++;
} );
assert.equal( counter, 3, "Multiple synchronic animations" );
- $elems.eq( 0 ).animate( { a:3 }, 0, function() {
+ $elems.eq( 0 ).animate( { a: 3 }, 0, function() {
assert.ok( true, "Animate a third simple property." );
counter++;
} );
- $elems.eq( 1 ).animate( { a:3 }, fxInterval * 20, function() {
+ $elems.eq( 1 ).animate( { a: 3 }, fxInterval * 20, function() {
counter++;
// Failed until [6115]
@@ -948,15 +952,33 @@ jQuery.each( {
num = 0;
// TODO: uncrowd this
- if ( t_h === "show" ) { num++; }
- if ( t_w === "show" ) { num++; }
- if ( t_w === "hide" || t_w === "show" ) { num++; }
- if ( t_h === "hide" || t_h === "show" ) { num++; }
- if ( t_o === "hide" || t_o === "show" ) { num++; }
- if ( t_w === "hide" ) { num++; }
- if ( t_o.constructor === Number ) { num += 2; }
- if ( t_w.constructor === Number ) { num += 2; }
- if ( t_h.constructor === Number ) { num += 2; }
+ if ( t_h === "show" ) {
+ num++;
+ }
+ if ( t_w === "show" ) {
+ num++;
+ }
+ if ( t_w === "hide" || t_w === "show" ) {
+ num++;
+ }
+ if ( t_h === "hide" || t_h === "show" ) {
+ num++;
+ }
+ if ( t_o === "hide" || t_o === "show" ) {
+ num++;
+ }
+ if ( t_w === "hide" ) {
+ num++;
+ }
+ if ( t_o.constructor === Number ) {
+ num += 2;
+ }
+ if ( t_w.constructor === Number ) {
+ num += 2;
+ }
+ if ( t_h.constructor === Number ) {
+ num += 2;
+ }
assert.expect( num );
@@ -2457,7 +2479,9 @@ QUnit.test( "Show/hide/toggle and display: inline", function( assert ) {
.hide().show( N ),
$el.clone().data( { call: "hide+toggle", done: "inline" } ).appendTo( fixture )
.hide().toggle( N )
- ], function( $clone ) { return $clone[ 0 ]; } );
+ ], function( $clone ) {
+ return $clone[ 0 ];
+ } );
// Animations not allowed to complete
interrupted = jQuery.map( [
@@ -2465,7 +2489,9 @@ QUnit.test( "Show/hide/toggle and display: inline", function( assert ) {
$el.clone().data( { call: "toggle+stop" } ).appendTo( fixture ).toggle( N ),
$el.clone().data( { call: "hide+show+stop" } ).appendTo( fixture ).hide().show( N ),
$el.clone().data( { call: "hide+toggle+stop" } ).appendTo( fixture ).hide().toggle( N )
- ], function( $clone ) { return $clone[ 0 ]; } );
+ ], function( $clone ) {
+ return $clone[ 0 ];
+ } );
// All elements should be inline-block during the animation
clock.tick( N / 2 );