From 3040abe23d2b65d4a1fa4c98981e1cff77c70935 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sun, 14 Sep 2025 09:51:21 -0700 Subject: [PATCH] Treat {verboseDeprecations: undefined} as a no-op, like other boolean config props --- lib/jasmine-core/jasmine.js | 9 ++------- spec/core/ConfigurationSpec.js | 25 ++----------------------- src/core/Configuration.js | 9 ++------- 3 files changed, 6 insertions(+), 37 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 7c847732..14ab310e 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -3406,7 +3406,8 @@ getJasmineRequireObj().Configuration = function(j$) { 'stopSpecOnExpectationFailure', 'autoCleanClosures', 'forbidDuplicateNames', - 'detectLateRejectionHandling' + 'detectLateRejectionHandling', + 'verboseDeprecations' ]; for (const k of booleanProps) { @@ -3423,12 +3424,6 @@ getJasmineRequireObj().Configuration = function(j$) { if (typeof changes.seed !== 'undefined') { this.#values.seed = changes.seed; } - - // TODO: in the next major release, make verboseDeprecations work like - // other boolean properties. - if (changes.hasOwnProperty('verboseDeprecations')) { - this.#values.verboseDeprecations = changes.verboseDeprecations; - } } } diff --git a/spec/core/ConfigurationSpec.js b/spec/core/ConfigurationSpec.js index bc548380..849dbf90 100644 --- a/spec/core/ConfigurationSpec.js +++ b/spec/core/ConfigurationSpec.js @@ -7,14 +7,10 @@ describe('Configuration', function() { 'hideDisabled', 'autoCleanClosures', 'forbidDuplicateNames', - 'detectLateRejectionHandling' - ]; - const allKeys = [ - ...standardBooleanKeys, - 'seed', - 'specFilter', + 'detectLateRejectionHandling', 'verboseDeprecations' ]; + const allKeys = [...standardBooleanKeys, 'seed', 'specFilter']; Object.freeze(standardBooleanKeys); Object.freeze(allKeys); @@ -86,23 +82,6 @@ describe('Configuration', function() { }); } - // TODO: in the next major release, treat verboseDeprecations like other booleans - it('sets verboseDeprecations when present', function() { - const subject = new jasmineUnderTest.Configuration(); - const orig = subject.verboseDeprecations; - - subject.update({ verboseDeprecations: !orig }); - expect(subject.verboseDeprecations).toEqual(!orig); - - subject.update({ verboseDeprecations: orig }); - expect(subject.verboseDeprecations).toEqual(orig); - - // For backwards compatibility, explicitly setting to undefined should - // work. Undefined isn't officially valid but gets treated like false. - subject.update({ verboseDeprecations: undefined }); - expect(subject.verboseDeprecations).toBeUndefined(); - }); - it('sets specFilter when truthy', function() { const subject = new jasmineUnderTest.Configuration(); const orig = subject.specFilter; diff --git a/src/core/Configuration.js b/src/core/Configuration.js index 4d32d5ce..82e30327 100644 --- a/src/core/Configuration.js +++ b/src/core/Configuration.js @@ -156,7 +156,8 @@ getJasmineRequireObj().Configuration = function(j$) { 'stopSpecOnExpectationFailure', 'autoCleanClosures', 'forbidDuplicateNames', - 'detectLateRejectionHandling' + 'detectLateRejectionHandling', + 'verboseDeprecations' ]; for (const k of booleanProps) { @@ -173,12 +174,6 @@ getJasmineRequireObj().Configuration = function(j$) { if (typeof changes.seed !== 'undefined') { this.#values.seed = changes.seed; } - - // TODO: in the next major release, make verboseDeprecations work like - // other boolean properties. - if (changes.hasOwnProperty('verboseDeprecations')) { - this.#values.verboseDeprecations = changes.verboseDeprecations; - } } }