Skip to content

Commit

Permalink
Use a smarter fix for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Oct 15, 2016
1 parent efa3582 commit f4707f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/bitmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
});
Expand All @@ -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()
{
Expand Down

0 comments on commit f4707f2

Please sign in to comment.