File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 6
6
"typings" : " index.d.ts" ,
7
7
"scripts" : {
8
8
"test" : " run-script-os" ,
9
- "test:darwin:linux" : " jasmine ' test/**/*.js' " ,
9
+ "test:darwin:linux" : " jasmine test/**/*.js" ,
10
10
"test-keyboard" : " node test/keyboard.js" ,
11
11
"test:win32" : " jasmine test/**/*.js" ,
12
12
"install" : " prebuild-install || node-gyp rebuild" ,
Original file line number Diff line number Diff line change @@ -17,9 +17,18 @@ describe('Integration/Screen', () => {
17
17
target = null ;
18
18
} ) ;
19
19
20
- it ( 'reads a pixel color' , ( ) => {
21
- var color_1 = elements . color_1 ;
22
- const color = robot . getPixelColor ( color_1 . x , color_1 . y ) ;
23
- expect ( color ) . toEqual ( 'c0ff33' ) ;
20
+ it ( 'reads a pixel color' , ( done ) => {
21
+ const maxDelay = 1000
22
+ jasmine . DEFAULT_TIMEOUT_INTERVAL = maxDelay + 1000
23
+ const expected = 'c0ff33'
24
+ const color_1 = elements . color_1 ;
25
+ const sleepTime = robot . getPixelColor ( color_1 . x , color_1 . y ) === expected ? 0
26
+ : maxDelay
27
+
28
+ setTimeout ( ( ) => {
29
+ const color = robot . getPixelColor ( color_1 . x , color_1 . y ) ;
30
+ expect ( color ) . toEqual ( expected ) ;
31
+ done ( )
32
+ } , sleepTime )
24
33
} ) ;
25
34
} ) ;
You can’t perform that action at this time.
0 commit comments