Skip to content

Commit

Permalink
Test that numpad throws on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed May 25, 2016
1 parent d7cc60e commit 7543df7
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions test/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,23 @@ test('Tap all keys.', function(t)
// This test won't fail if there's an issue, but it will help you identify an issue if ran locally.
test('Tap all numpad keys.', function(t)
{
if (os.platform() === 'linux')
{
t.skip("No numpad keycodes on Linux.");
t.end();
}

var nums = '0123456789'.split('');

for (var x in nums)
{
t.ok(robot.keyTap('numpad_' + nums[x]), 'tap ' + 'numpad_' + nums[x] + '.');
}
var nums = '0123456789'.split('');

for (var x in nums)
{
if (os.platform() === 'linux')
{
/* jshint loopfunc:true */
t.throws(function()
{
robot.keyTap('numpad_' + nums[x]);
}, /Invalid key code/, 'tap ' + 'numpad_' + nums[x] + ' threw an error.');
}
else
{
t.ok(robot.keyTap('numpad_' + nums[x]), 'tap ' + 'numpad_' + nums[x] + '.');
}
}

t.end();
});

0 comments on commit 7543df7

Please sign in to comment.