aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/serialize.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2022-06-28 12:39:01 +0200
committerGitHub <noreply@github.com>2022-06-28 12:39:01 +0200
commitfae5fee8b435cc20352d28b0a384b9784b1ad9ed (patch)
tree86ae9425c469a476c25ce62399297d35472dbc2c /test/unit/serialize.js
parent52f452b2e8881e5ec5c9e880e277c8ecf633e8dc (diff)
downloadjquery-fae5fee8b435cc20352d28b0a384b9784b1ad9ed.tar.gz
jquery-fae5fee8b435cc20352d28b0a384b9784b1ad9ed.zip
Tests: Exclude tests based on compilation flags, not API presence
Introduces a new test API, `includesModule`. The method returns whether a particular module like "ajax" or "deprecated" is included in the current jQuery build; it handles the slim build as well. The util was created so that we don't treat presence of particular APIs to decide whether to run a test as then if we accidentally remove an API, the tests would still not fail. Fixes gh-5069 Closes gh-5046
Diffstat (limited to 'test/unit/serialize.js')
-rw-r--r--test/unit/serialize.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/serialize.js b/test/unit/serialize.js
index 18f7b299d..24d888fb9 100644
--- a/test/unit/serialize.js
+++ b/test/unit/serialize.js
@@ -77,7 +77,7 @@ QUnit.test( "jQuery.param()", function( assert ) {
assert.equal( jQuery.param( params ), "", "jQuery.param( undefined ) === empty string" );
} );
-QUnit[ jQuery.ajax ? "test" : "skip" ]( "jQuery.param() not affected by ajaxSettings", function( assert ) {
+QUnit[ includesModule( "ajax" ) ? "test" : "skip" ]( "jQuery.param() not affected by ajaxSettings", function( assert ) {
assert.expect( 1 );
var oldTraditional = jQuery.ajaxSettings.traditional;