@@ -4,37 +4,31 @@ const os = require("os");
44// TODO: Need tests for keyToggle, typeString, typeStringDelayed, and setKeyboardDelay.
55
66describe ( "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+ } ) ;
1212
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+ } ) ;
1616
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 ( "" ) ;
2020
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+ } ) ;
2525
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 ( "" ) ;
2929
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+ } ) ;
4034} ) ;
0 commit comments