@@ -13,11 +13,11 @@ const searchRegion = new Region(0, 0, 100, 100);
1313
1414beforeAll ( ( ) => {
1515 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 ) ) ;
1717 } ) ;
1818
1919 VisionAdapter . prototype . screenSize = jest . fn ( ( ) => {
20- return searchRegion ;
20+ return Promise . resolve ( searchRegion ) ;
2121 } ) ;
2222} ) ;
2323
@@ -26,7 +26,7 @@ describe("Screen.", () => {
2626 const matchResult = new MatchResult ( 0.99 , searchRegion ) ;
2727
2828 VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
29- return matchResult ;
29+ return Promise . resolve ( matchResult ) ;
3030 } ) ;
3131
3232 const visionAdapterMock = new VisionAdapter ( ) ;
@@ -47,7 +47,7 @@ describe("Screen.", () => {
4747 const matchResult = new MatchResult ( 0.8 , searchRegion ) ;
4848
4949 VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
50- return matchResult ;
50+ return Promise . resolve ( matchResult ) ;
5151 } ) ;
5252
5353 const visionAdapterMock = new VisionAdapter ( ) ;
@@ -64,7 +64,7 @@ describe("Screen.", () => {
6464 const matchResult = new MatchResult ( minMatch , searchRegion ) ;
6565
6666 VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
67- return matchResult ;
67+ return Promise . resolve ( matchResult ) ;
6868 } ) ;
6969
7070 const visionAdapterMock = new VisionAdapter ( ) ;
@@ -88,7 +88,7 @@ describe("Screen.", () => {
8888 const matchResult = new MatchResult ( 0.99 , searchRegion ) ;
8989
9090 VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
91- return matchResult ;
91+ return Promise . resolve ( matchResult ) ;
9292 } ) ;
9393
9494 const visionAdapterMock = new VisionAdapter ( ) ;
@@ -113,7 +113,7 @@ describe("Screen.", () => {
113113 const matchResult = new MatchResult ( minMatch , searchRegion ) ;
114114
115115 VisionAdapter . prototype . findOnScreenRegion = jest . fn ( ( ) => {
116- return matchResult ;
116+ return Promise . resolve ( matchResult ) ;
117117 } ) ;
118118
119119 const visionAdapterMock = new VisionAdapter ( ) ;
0 commit comments