aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTimmy Willison <timmywil@users.noreply.github.com>2024-06-15 09:10:59 -0400
committerGitHub <noreply@github.com>2024-06-15 09:10:59 -0400
commitfc864c83c88179c519633330acbc48f16a6b3cd5 (patch)
treecd8eb366dba436b99d94eb8ca611262fcc195204 /test
parent8eb35e8513b0cb7a19677b6934ddd98ad7b6f16f (diff)
downloadjquery-fc864c83c88179c519633330acbc48f16a6b3cd5.tar.gz
jquery-fc864c83c88179c519633330acbc48f16a6b3cd5.zip
Build: upgrade dependencies, including eslint 9.4.0 and uglify 3.7.7
- Sinon is already at the latest version that supports IE9. - Upgraded uglify to 3.7.7, which is the latest that worked with IE9. I tried 3.9.4, which we are using in jquery-migrate, and 3.8.1, but there were failures in traversing ("Permission denied" errors). - Upgraded eslint to version 9, which required some changes. Mainly, unused arguments in catch expressions error by default in 9+. The config now makes use of `caughtErrorsIgnorePattern`, which is set to `"^_"`, the same as unused function params. - Ignored main branch dist files when switching branches. Closes gh-5508
Diffstat (limited to 'test')
-rw-r--r--test/unit/ajax.js4
-rw-r--r--test/unit/attributes.js10
-rw-r--r--test/unit/css.js4
-rw-r--r--test/unit/deprecated.js2
-rw-r--r--test/unit/event.js14
-rw-r--r--test/unit/manipulation.js6
6 files changed, 19 insertions, 21 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index dfe73569f..fc8731e1b 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -2001,9 +2001,7 @@ QUnit.module( "ajax", {
} );
success = true;
xhr.abort();
- } catch ( e ) {
-
- }
+ } catch ( _ ) {}
assert.ok( success, "document.location did not generate exception" );
} );
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 095404ab2..42c311deb 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -429,7 +429,7 @@ QUnit.test( "attr(String, Object)", function( assert ) {
thrown = true;
try {
jQuery( check ).attr( "type", "checkbox" );
- } catch ( e ) {
+ } catch ( _ ) {
thrown = false;
}
assert.ok( thrown, "Exception thrown when trying to change type property" );
@@ -439,7 +439,7 @@ QUnit.test( "attr(String, Object)", function( assert ) {
thrown = true;
try {
check.attr( "type", "checkbox" );
- } catch ( e ) {
+ } catch ( _ ) {
thrown = false;
}
assert.ok( thrown, "Exception thrown when trying to change type property" );
@@ -610,7 +610,7 @@ QUnit.test( "removeAttr(String)", function( assert ) {
try {
$first = jQuery( "#first" ).attr( "contenteditable", "true" ).removeAttr( "contenteditable" );
assert.equal( $first.attr( "contenteditable" ), undefined, "Remove the contenteditable attribute" );
- } catch ( e ) {
+ } catch ( _ ) {
assert.ok( false, "Removing contenteditable threw an error (trac-10429)" );
}
@@ -1006,7 +1006,7 @@ if ( "value" in document.createElement( "meter" ) &&
assert.equal( typeof $progress.val(), "number", "progress, returns a number and does not throw exception" );
assert.equal( $progress.val(), $progress[ 0 ].value, "progress, api matches host and does not throw exception" );
- } catch ( e ) {}
+ } catch ( _ ) {}
$meter.remove();
$progress.remove();
@@ -1780,7 +1780,7 @@ QUnit.test( "non-lowercase boolean attribute getters should not crash", function
try {
assert.strictEqual( elem.attr( original ), lowercased,
"The '" + this + "' attribute getter should return the lowercased name" );
- } catch ( e ) {
+ } catch ( _ ) {
assert.ok( false, "The '" + this + "' attribute getter threw" );
}
} );
diff --git a/test/unit/css.js b/test/unit/css.js
index df0da5222..a2f65da7c 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -318,7 +318,7 @@ QUnit.test( "css(String, Object)", function( assert ) {
success = true;
try {
jQuery( "#foo" ).css( "backgroundColor", "rgba(0, 0, 0, 0.1)" );
- } catch ( e ) {
+ } catch ( _ ) {
success = false;
}
assert.ok( success, "Setting RGBA values does not throw Error (trac-5509)" );
@@ -1065,7 +1065,7 @@ QUnit.test( "internal ref to elem.runtimeStyle (bug trac-7608)", function( asser
try {
jQuery( "#foo" ).css( { "width": "0%" } ).css( "width" );
- } catch ( e ) {
+ } catch ( _ ) {
result = false;
}
diff --git a/test/unit/deprecated.js b/test/unit/deprecated.js
index bfe57d20a..4cf2f7aec 100644
--- a/test/unit/deprecated.js
+++ b/test/unit/deprecated.js
@@ -448,7 +448,7 @@ supportjQuery.each(
var fn;
try {
fn = Function( "return " + source )();
- } catch ( e ) {}
+ } catch ( _ ) {}
QUnit[ jQuery.isFunction && fn ? "test" : "skip" ]( "isFunction(" + subclass + ")",
function( assert ) {
diff --git a/test/unit/event.js b/test/unit/event.js
index b1d5bde56..09411e484 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -12,12 +12,12 @@ QUnit.test( "null or undefined handler", function( assert ) {
try {
jQuery( "#firstp" ).on( "click", null );
assert.ok( true, "Passing a null handler will not throw an exception" );
- } catch ( e ) {}
+ } catch ( _ ) {}
try {
jQuery( "#firstp" ).on( "click", undefined );
assert.ok( true, "Passing an undefined handler will not throw an exception" );
- } catch ( e ) {}
+ } catch ( _ ) {}
var expectedElem = jQuery( "#firstp" );
var actualElem = expectedElem.on( "click", null );
@@ -1050,7 +1050,7 @@ QUnit.test( "trigger(type, [data], [fn])", function( assert ) {
elem2 = jQuery( "#form input" ).eq( 0 );
elem2.get( 0 ).style.display = "none";
elem2.trigger( "focus" );
- } catch ( e ) {
+ } catch ( _ ) {
pass = false;
}
assert.ok( pass, "Trigger focus on hidden element" );
@@ -1058,7 +1058,7 @@ QUnit.test( "trigger(type, [data], [fn])", function( assert ) {
pass = true;
try {
jQuery( "#qunit-fixture table" ).eq( 0 ).on( "test:test", function() {} ).trigger( "test:test" );
- } catch ( e ) {
+ } catch ( _ ) {
pass = false;
}
assert.ok( pass, "Trigger on a table with a colon in the even type, see trac-3533" );
@@ -1459,7 +1459,7 @@ QUnit[ /(ipad|iphone|ipod)/i.test( navigator.userAgent ) ? "skip" : "test" ](
window.onmessage = null;
done();
}
- } catch ( e ) {
+ } catch ( _ ) {
// Messages may come from other sources, like browser extensions;
// some may not be valid JSONs and thus cannot be `JSON.parse`d.
@@ -2307,7 +2307,7 @@ QUnit.test( "custom events with colons (trac-3533, trac-8272)", function( assert
try {
tab.trigger( "back:forth" );
assert.ok( true, "colon events don't throw" );
- } catch ( e ) {
+ } catch ( _ ) {
assert.ok( false, "colon events die" );
}
tab.remove();
@@ -2945,7 +2945,7 @@ QUnit.test( "String.prototype.namespace does not cause trigger() to throw (trac-
try {
jQuery( "<p>" ).trigger( "foo.bar" );
- } catch ( e ) {
+ } catch ( _ ) {
errored = true;
}
assert.equal( errored, false, "trigger() did not throw exception" );
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 7f356432a..aa81c122a 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -1990,7 +1990,7 @@ QUnit.test( "clone()/html() don't expose jQuery/Sizzle expandos (trac-12858)", f
$content.find( ":nth-child(1):lt(4)" ).data( "test", true );
// But don't break on a non-Sizzle build
- } catch ( e ) {
+ } catch ( _ ) {
$content.find( "*" ).data( "test", true );
}
@@ -2304,7 +2304,7 @@ QUnit.test( "domManip plain-text caching (trac-6779)", function( assert ) {
for ( i = 0; i < bad.length; i++ ) {
try {
$f.append( bad[ i ] );
- } catch ( e ) {}
+ } catch ( _ ) {}
}
assert.equal( $f.text(), bad.join( "" ), "Cached strings that match Object properties" );
$f.remove();
@@ -2478,7 +2478,7 @@ QUnit.test( "Guard against exceptions when clearing safeChildNodes", function( a
try {
div = jQuery( "<div></div><hr/><code></code><b></b>" );
- } catch ( e ) {}
+ } catch ( _ ) {}
assert.ok( div && div.jquery, "Created nodes safely, guarded against exceptions on safeChildNodes[ -1 ]" );
} );