From f4707f2776f51410b585f6e5e03af5428488cc9d Mon Sep 17 00:00:00 2001 From: Jason Stallings Date: Sat, 15 Oct 2016 18:59:08 -0500 Subject: [PATCH] Use a smarter fix for tests. --- test/bitmap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/bitmap.js b/test/bitmap.js index 4f688861..78df85b6 100644 --- a/test/bitmap.js +++ b/test/bitmap.js @@ -35,7 +35,8 @@ test('Get a bitmap of a specific size.', function(t) var img = robot.screen.capture(0, 0, size, size); // Support for higher density screens. - if (img.width == (size*2)) size = img.width; + var multi = img.width / size; + var size = size * multi; t.equals(img.height, size, 'make sure image is expected height.'); t.equals(img.width, size, 'make sure image is expected width.'); }); @@ -53,7 +54,9 @@ test('Get a bitmap and make sure the colorAt works as expected.', function(t) var height = screenSize.height; // Support for higher density screens. - if (img.width === (width*2)) width = img.width; height = img.height; + var multi = img.width / width; + width = width * multi; + height = height * multi; t.throws(function() {