diff --git a/lib/helpers/macos/parseCodePoints.js b/lib/helpers/macos/parseCodePoints.js index 7c58984..2b5b537 100644 --- a/lib/helpers/macos/parseCodePoints.js +++ b/lib/helpers/macos/parseCodePoints.js @@ -32,6 +32,7 @@ exports.parseCodePoints = function (codes) { } else if (code.length === 1) { throw new Error(`unknown key (\\u${code.charCodeAt(0).toString(16)})`); } else { + // Matches an error thrown by robotjs. throw new Error('Invalid key code specified.'); } } diff --git a/test/helpers/macos/applescript.js b/test/helpers/macos/applescript.js index 0004cf5..a6e30ef 100644 --- a/test/helpers/macos/applescript.js +++ b/test/helpers/macos/applescript.js @@ -43,7 +43,7 @@ suite('helpers/macos/applescript', () => { { description: 'throws on invalid code', keyCombination: ['df daf% ?'], - throws: /unknown key/, + throws: /Invalid key code/, }, ], );