Add experimental safariYieldStrategy: "time" config option
This greatly improves speed, at least in jasmine-core's own tests.
This commit is contained in:
@@ -15,7 +15,8 @@ describe('Configuration', function() {
|
||||
'seed',
|
||||
'specFilter',
|
||||
'extraItStackFrames',
|
||||
'extraDescribeStackFrames'
|
||||
'extraDescribeStackFrames',
|
||||
'safariYieldStrategy'
|
||||
];
|
||||
Object.freeze(standardBooleanKeys);
|
||||
Object.freeze(allKeys);
|
||||
@@ -36,6 +37,7 @@ describe('Configuration', function() {
|
||||
expect(subject.detectLateRejectionHandling).toEqual(false);
|
||||
expect(subject.extraItStackFrames).toEqual(0);
|
||||
expect(subject.extraDescribeStackFrames).toEqual(0);
|
||||
expect(subject.safariYieldStrategy).toEqual('count');
|
||||
});
|
||||
|
||||
describe('copy()', function() {
|
||||
@@ -137,5 +139,28 @@ describe('Configuration', function() {
|
||||
subject.update({ extraDescribeStackFrames: 100000 });
|
||||
expect(subject.extraDescribeStackFrames).toEqual(100000);
|
||||
});
|
||||
|
||||
it('sets safariYieldStrategy when valid', function() {
|
||||
const subject = new privateUnderTest.Configuration();
|
||||
|
||||
subject.update({ safariYieldStrategy: undefined });
|
||||
expect(subject.safariYieldStrategy).toEqual('count');
|
||||
|
||||
subject.update({ safariYieldStrategy: 'time' });
|
||||
expect(subject.safariYieldStrategy).toEqual('time');
|
||||
|
||||
subject.update({ safariYieldStrategy: 'count' });
|
||||
expect(subject.safariYieldStrategy).toEqual('count');
|
||||
});
|
||||
|
||||
it('rejcts invalid safariYieldStrategy values', function() {
|
||||
const subject = new privateUnderTest.Configuration();
|
||||
|
||||
expect(function() {
|
||||
subject.update({ safariYieldStrategy: 'thyme' });
|
||||
}).toThrowError(
|
||||
"Invalid safariYieldStrategy value. Valid values are 'count' and 'time'."
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user