Skip to content

Commit 7543df7

Browse files
committed
Test that numpad throws on Linux.
1 parent d7cc60e commit 7543df7

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

test/keyboard.js

+17-12
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,23 @@ test('Tap all keys.', function(t)
3737
// This test won't fail if there's an issue, but it will help you identify an issue if ran locally.
3838
test('Tap all numpad keys.', function(t)
3939
{
40-
if (os.platform() === 'linux')
41-
{
42-
t.skip("No numpad keycodes on Linux.");
43-
t.end();
44-
}
45-
46-
var nums = '0123456789'.split('');
47-
48-
for (var x in nums)
49-
{
50-
t.ok(robot.keyTap('numpad_' + nums[x]), 'tap ' + 'numpad_' + nums[x] + '.');
51-
}
40+
var nums = '0123456789'.split('');
41+
42+
for (var x in nums)
43+
{
44+
if (os.platform() === 'linux')
45+
{
46+
/* jshint loopfunc:true */
47+
t.throws(function()
48+
{
49+
robot.keyTap('numpad_' + nums[x]);
50+
}, /Invalid key code/, 'tap ' + 'numpad_' + nums[x] + ' threw an error.');
51+
}
52+
else
53+
{
54+
t.ok(robot.keyTap('numpad_' + nums[x]), 'tap ' + 'numpad_' + nums[x] + '.');
55+
}
56+
}
5257

5358
t.end();
5459
});

0 commit comments

Comments
 (0)