Treat {verboseDeprecations: undefined} as a no-op, like other boolean config props

This commit is contained in:
Steve Gravrock
2025-09-14 09:51:21 -07:00
parent 4d3f6b272a
commit 3040abe23d
3 changed files with 6 additions and 37 deletions

View File

@@ -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;