Merge pull request #16602 from Snuffleupagus/gulpfile-TESTING-nullish-coalescing

Use nullish coalescing when handling the `TESTING` build-target
This commit is contained in:
Jonas Jenwald 2023-06-26 14:54:45 +02:00 committed by GitHub
commit 21383fb2d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,10 +185,7 @@ function createWebpackConfig(
const bundleDefines = builder.merge(defines, {
BUNDLE_VERSION: versionInfo.version,
BUNDLE_BUILD: versionInfo.commit,
TESTING:
defines.TESTING !== undefined
? defines.TESTING
: process.env.TESTING === "true",
TESTING: defines.TESTING ?? process.env.TESTING === "true",
DEFAULT_PREFERENCES: defaultPreferencesDir
? getDefaultPreferences(defaultPreferencesDir)
: {},
@ -769,10 +766,7 @@ function buildDefaultPreferences(defines, dir) {
SKIP_BABEL: false,
BUNDLE_VERSION: 0, // Dummy version
BUNDLE_BUILD: 0, // Dummy build
TESTING:
defines.TESTING !== undefined
? defines.TESTING
: process.env.TESTING === "true",
TESTING: defines.TESTING ?? process.env.TESTING === "true",
});
const inputStream = merge([
@ -1547,10 +1541,7 @@ function buildLib(defines, dir) {
const bundleDefines = builder.merge(defines, {
BUNDLE_VERSION: versionInfo.version,
BUNDLE_BUILD: versionInfo.commit,
TESTING:
defines.TESTING !== undefined
? defines.TESTING
: process.env.TESTING === "true",
TESTING: defines.TESTING ?? process.env.TESTING === "true",
DEFAULT_PREFERENCES: getDefaultPreferences(
defines.SKIP_BABEL ? "lib/" : "lib-legacy/"
),