Configurable spec/suite filename detection

* Adds extraItStackFrames and extraDescribeStackFrames config properties.
* Un-deprecates the filename properties of reporter events.
* Fixes #2065.
This commit is contained in:
Steve Gravrock
2025-11-01 14:13:51 -07:00
parent fee7e6e64e
commit ff9feb29d3
10 changed files with 251 additions and 42 deletions

View File

@@ -13,7 +13,9 @@ describe('Configuration', function() {
...standardBooleanKeys,
'seed',
'specFilter',
'verboseDeprecations'
'verboseDeprecations',
'extraItStackFrames',
'extraDescribeStackFrames'
];
Object.freeze(standardBooleanKeys);
Object.freeze(allKeys);
@@ -32,6 +34,8 @@ describe('Configuration', function() {
expect(subject.forbidDuplicateNames).toEqual(false);
expect(subject.verboseDeprecations).toEqual(false);
expect(subject.detectLateRejectionHandling).toEqual(false);
expect(subject.extraItStackFrames).toEqual(0);
expect(subject.extraDescribeStackFrames).toEqual(0);
});
describe('copy()', function() {
@@ -130,5 +134,25 @@ describe('Configuration', function() {
subject.update({ seed: null });
expect(subject.seed).toBeNull();
});
it('sets extraItStackFrames when not undefined', function() {
const subject = new jasmineUnderTest.Configuration();
subject.update({ extraItStackFrames: undefined });
expect(subject.extraItStackFrames).toEqual(0);
subject.update({ extraItStackFrames: 100000 });
expect(subject.extraItStackFrames).toEqual(100000);
});
it('sets extraDescribeStackFrames when not undefined', function() {
const subject = new jasmineUnderTest.Configuration();
subject.update({ extraDescribeStackFrames: undefined });
expect(subject.extraDescribeStackFrames).toEqual(0);
subject.update({ extraDescribeStackFrames: 100000 });
expect(subject.extraDescribeStackFrames).toEqual(100000);
});
});
});