Handle case where firefoxGcIntervals could be set to null (#6826)

This commit is contained in:
Jennifer Shehane
2020-03-24 21:12:38 +06:30
committed by GitHub
parent 6eda473163
commit bbb5ff95c1
2 changed files with 11 additions and 2 deletions
@@ -1,4 +1,4 @@
import { get, isNumber } from 'lodash'
import { get, isNumber, isNull } from 'lodash'
export function createIntervalGetter (config) {
return () => {
@@ -8,7 +8,7 @@ export function createIntervalGetter (config) {
const intervals = config('firefoxGcInterval')
if (isNumber(intervals)) {
if (isNumber(intervals) || isNull(intervals)) {
return intervals
}
@@ -27,6 +27,15 @@ describe('driver/src/util/firefox_forced_gc', () => {
})).to.eq(99)
})
it('returns null if firefoxGcInterval is null', () => {
expect(run({
browser: {
family: 'firefox',
},
firefoxGcInterval: null,
})).to.eq(null)
})
it('returns the appropriate interval for open mode', () => {
expect(run({
browser: {