@@ -4,37 +4,31 @@ const os = require("os");
4
4
// TODO: Need tests for keyToggle, typeString, typeStringDelayed, and setKeyboardDelay.
5
5
6
6
describe ( "Keyboard" , ( ) => {
7
- it ( "Tap a key." , function ( ) {
8
- expect ( ( ) => libnut . keyTap ( "a" ) ) . not . toThrow ( ) ;
9
- expect ( ( ) => libnut . keyTap ( "a" , "control" ) ) . not . toThrow ( ) ;
10
- expect ( ( ) => libnut . keyTap ( ) ) . toThrowError ( / A s t r i n g w a s e x p e c t e d / ) ;
11
- } ) ;
7
+ it ( "Tap a key." , function ( ) {
8
+ expect ( ( ) => libnut . keyTap ( "a" ) ) . not . toThrow ( ) ;
9
+ expect ( ( ) => libnut . keyTap ( "a" , "control" ) ) . not . toThrow ( ) ;
10
+ expect ( ( ) => libnut . keyTap ( ) ) . toThrowError ( / A s t r i n g w a s e x p e c t e d / ) ;
11
+ } ) ;
12
12
13
- it ( "Tap a key with modifier array." , function ( ) {
14
- expect ( ( ) => libnut . keyTap ( "a" , [ "alt" , "control" ] ) ) . not . toThrow ( ) ;
15
- } ) ;
13
+ it ( "Tap a key with modifier array." , function ( ) {
14
+ expect ( ( ) => libnut . keyTap ( "a" , [ "alt" , "control" ] ) ) . not . toThrow ( ) ;
15
+ } ) ;
16
16
17
- // This it won't fail if there's an issue, but it will help you identify an issue if ran locally.
18
- it ( "Tap all keys." , function ( ) {
19
- const chars = "abcdefghijklmnopqrstuvwxyz1234567890,./;'[]\\" . split ( "" ) ;
17
+ // This it won't fail if there's an issue, but it will help you identify an issue if ran locally.
18
+ it ( "Tap all keys." , function ( ) {
19
+ const chars = "abcdefghijklmnopqrstuvwxyz1234567890,./;'[]\\" . split ( "" ) ;
20
20
21
- for ( const x in chars ) {
22
- expect ( ( ) => libnut . keyTap ( chars [ x ] ) ) . not . toThrow ( ) ;
23
- }
24
- } ) ;
21
+ for ( const x in chars ) {
22
+ expect ( ( ) => libnut . keyTap ( chars [ x ] ) ) . not . toThrow ( ) ;
23
+ }
24
+ } ) ;
25
25
26
- // This it won't fail if there's an issue, but it will help you identify an issue if ran locally.
27
- it ( "Tap all numpad keys." , function ( ) {
28
- const nums = "0123456789" . split ( "" ) ;
26
+ // This it won't fail if there's an issue, but it will help you identify an issue if ran locally.
27
+ it ( "Tap all numpad keys." , function ( ) {
28
+ const nums = "0123456789" . split ( "" ) ;
29
29
30
- for ( const x in nums ) {
31
- if ( os . platform ( ) === "linux" ) {
32
- expect ( ( ) => libnut . keyTap ( "numpad_" + nums [ x ] ) ) . toThrowError (
33
- / I n v a l i d k e y c o d e /
34
- ) ;
35
- } else {
36
- expect ( ( ) => libnut . keyTap ( "numpad_" + nums [ x ] ) ) . not . toThrow ( ) ;
37
- }
38
- }
39
- } ) ;
30
+ for ( const x in nums ) {
31
+ expect ( ( ) => libnut . keyTap ( "numpad_" + nums [ x ] ) ) . not . toThrow ( ) ;
32
+ }
33
+ } ) ;
40
34
} ) ;
0 commit comments