@@ -13,11 +13,11 @@ const searchRegion = new Region(0, 0, 100, 100);
13
13
14
14
beforeAll ( ( ) => {
15
15
VisionAdapter . prototype . grabScreen = jest . fn ( ( ) => {
16
- return new Image ( searchRegion . width , searchRegion . height , new ArrayBuffer ( 0 ) , 3 ) ;
16
+ return Promise . resolve ( new Image ( searchRegion . width , searchRegion . height , new ArrayBuffer ( 0 ) , 3 ) ) ;
17
17
} ) ;
18
18
19
19
VisionAdapter . prototype . screenSize = jest . fn ( ( ) => {
20
- return searchRegion ;
20
+ return Promise . resolve ( searchRegion ) ;
21
21
} ) ;
22
22
} ) ;
23
23
@@ -26,7 +26,7 @@ describe("Screen.", () => {
26
26
const matchResult = new MatchResult ( 0.99 , searchRegion ) ;
27
27
28
28
VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
29
- return matchResult ;
29
+ return Promise . resolve ( matchResult ) ;
30
30
} ) ;
31
31
32
32
const visionAdapterMock = new VisionAdapter ( ) ;
@@ -47,7 +47,7 @@ describe("Screen.", () => {
47
47
const matchResult = new MatchResult ( 0.8 , searchRegion ) ;
48
48
49
49
VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
50
- return matchResult ;
50
+ return Promise . resolve ( matchResult ) ;
51
51
} ) ;
52
52
53
53
const visionAdapterMock = new VisionAdapter ( ) ;
@@ -64,7 +64,7 @@ describe("Screen.", () => {
64
64
const matchResult = new MatchResult ( minMatch , searchRegion ) ;
65
65
66
66
VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
67
- return matchResult ;
67
+ return Promise . resolve ( matchResult ) ;
68
68
} ) ;
69
69
70
70
const visionAdapterMock = new VisionAdapter ( ) ;
@@ -88,7 +88,7 @@ describe("Screen.", () => {
88
88
const matchResult = new MatchResult ( 0.99 , searchRegion ) ;
89
89
90
90
VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
91
- return matchResult ;
91
+ return Promise . resolve ( matchResult ) ;
92
92
} ) ;
93
93
94
94
const visionAdapterMock = new VisionAdapter ( ) ;
@@ -113,7 +113,7 @@ describe("Screen.", () => {
113
113
const matchResult = new MatchResult ( minMatch , searchRegion ) ;
114
114
115
115
VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
116
- return matchResult ;
116
+ return Promise . resolve ( matchResult ) ;
117
117
} ) ;
118
118
119
119
const visionAdapterMock = new VisionAdapter ( ) ;
0 commit comments