From fae5fee8b435cc20352d28b0a384b9784b1ad9ed Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Tue, 28 Jun 2022 12:39:01 +0200 Subject: 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 --- build/tasks/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'build/tasks/build.js') diff --git a/build/tasks/build.js b/build/tasks/build.js index e376be6cc..e344f991b 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -10,6 +10,7 @@ module.exports = function( grunt ) { const fs = require( "fs" ); const path = require( "path" ); const rollup = require( "rollup" ); + const slimBuildFlags = require( "./lib/slim-build-flags" ); const rollupFileOverrides = require( "./lib/rollup-plugin-file-overrides" ); const Insight = require( "insight" ); const pkg = require( "../../package.json" ); @@ -60,7 +61,6 @@ module.exports = function( grunt ) { const done = this.async(); try { - const slimFlags = [ "-ajax", "-callbacks", "-deferred", "-effects", "-queue" ]; const flags = this.flags; const optIn = flags[ "*" ]; let name = grunt.option( "filename" ); @@ -79,7 +79,7 @@ module.exports = function( grunt ) { if ( flags.slim ) { delete flags.slim; - for ( const flag of slimFlags ) { + for ( const flag of slimBuildFlags ) { flags[ flag ] = true; } } -- cgit v1.2.3