From 7543df7a592bb33c0cfcf8244c0fa675d6def153 Mon Sep 17 00:00:00 2001 From: Jason Stallings Date: Tue, 24 May 2016 23:46:45 -0500 Subject: [PATCH] Test that numpad throws on Linux. --- test/keyboard.js | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/test/keyboard.js b/test/keyboard.js index 06f77144..92ec0724 100644 --- a/test/keyboard.js +++ b/test/keyboard.js @@ -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(); }); \ No newline at end of file