Use single assert bounds helper

This commit is contained in:
Kevin Sawicki 2016-09-08 13:33:43 -07:00
Родитель 71fac07a93
Коммит d88f70caa2
1 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -1360,18 +1360,12 @@ describe('browser-window module', function () {
})
})
const assertPositionsEqual = (expect, actual) => {
if (isIntegerScaleFactor()) {
assert.deepEqual(expect, actual)
} else {
assertWithinDelta(expect[0], actual[0], 1, 'x')
assertWithinDelta(expect[1], actual[1], 1, 'y')
}
}
const assertBoundsEqual = (expect, actual) => {
if (isIntegerScaleFactor()) {
assert.deepEqual(expect, actual)
} else if (Array.isArray(actual)) {
assertWithinDelta(expect[0], actual[0], 1, 'x')
assertWithinDelta(expect[1], actual[1], 1, 'y')
} else {
assertWithinDelta(expect.x, actual.x, 1, 'x')
assertWithinDelta(expect.y, actual.y, 1, 'y')