1- import { NativeAdapter } from "./adapter/native.adapter.class" ;
2- import { VisionAdapter } from "./adapter/vision.adapter.class" ;
3- import { Image } from "./image.class" ;
4- import { LocationParameters } from "./locationparameters.class" ;
5- import { MatchRequest } from "./match-request.class" ;
6- import { MatchResult } from "./match-result.class" ;
7- import { Region } from "./region.class" ;
8- import { Screen } from "./screen.class" ;
1+ import { VisionAdapter } from "./adapter/vision.adapter.class" ;
2+ import { Image } from "./image.class" ;
3+ import { LocationParameters } from "./locationparameters.class" ;
4+ import { MatchRequest } from "./match-request.class" ;
5+ import { MatchResult } from "./match-result.class" ;
6+ import { Region } from "./region.class" ;
7+ import { Screen } from "./screen.class" ;
98
109jest . mock ( "./adapter/native.adapter.class" ) ;
1110jest . mock ( "./adapter/vision.adapter.class" ) ;
1211
1312const searchRegion = new Region ( 0 , 0 , 100 , 100 ) ;
1413
1514beforeAll ( ( ) => {
16- NativeAdapter . prototype . grabScreen = jest . fn ( ( ) => {
15+ VisionAdapter . prototype . grabScreen = jest . fn ( ( ) => {
1716 return new Image ( searchRegion . width , searchRegion . height , new ArrayBuffer ( 0 ) , 3 ) ;
1817 } ) ;
1918
20- NativeAdapter . prototype . screenSize = jest . fn ( ( ) => {
19+ VisionAdapter . prototype . screenSize = jest . fn ( ( ) => {
2120 return searchRegion ;
2221 } ) ;
2322} ) ;
@@ -31,9 +30,8 @@ describe("Screen.", () => {
3130 } ) ;
3231
3332 const visionAdapterMock = new VisionAdapter ( ) ;
34- const nativeAdapterMock = new NativeAdapter ( ) ;
3533
36- const SUT = new Screen ( visionAdapterMock , nativeAdapterMock ) ;
34+ const SUT = new Screen ( visionAdapterMock ) ;
3735 const imagePath = "test/path/to/image.png" ;
3836 await expect ( SUT . findOnScreen ( imagePath ) ) . resolves . toEqual ( matchResult . location ) ;
3937 const matchRequest = new MatchRequest (
@@ -53,9 +51,8 @@ describe("Screen.", () => {
5351 } ) ;
5452
5553 const visionAdapterMock = new VisionAdapter ( ) ;
56- const nativeAdapterMock = new NativeAdapter ( ) ;
5754
58- const SUT = new Screen ( visionAdapterMock , nativeAdapterMock ) ;
55+ const SUT = new Screen ( visionAdapterMock ) ;
5956 const imagePath = "test/path/to/image.png" ;
6057 await expect ( SUT . findOnScreen ( imagePath ) )
6158 . rejects
@@ -71,9 +68,8 @@ describe("Screen.", () => {
7168 } ) ;
7269
7370 const visionAdapterMock = new VisionAdapter ( ) ;
74- const nativeAdapterMock = new NativeAdapter ( ) ;
7571
76- const SUT = new Screen ( visionAdapterMock , nativeAdapterMock ) ;
72+ const SUT = new Screen ( visionAdapterMock ) ;
7773
7874 const imagePath = "test/path/to/image.png" ;
7975 const parameters = new LocationParameters ( undefined , minMatch ) ;
@@ -96,9 +92,8 @@ describe("Screen.", () => {
9692 } ) ;
9793
9894 const visionAdapterMock = new VisionAdapter ( ) ;
99- const nativeAdapterMock = new NativeAdapter ( ) ;
10095
101- const SUT = new Screen ( visionAdapterMock , nativeAdapterMock ) ;
96+ const SUT = new Screen ( visionAdapterMock ) ;
10297
10398 const imagePath = "test/path/to/image.png" ;
10499 const parameters = new LocationParameters ( customSearchRegion ) ;
@@ -122,9 +117,8 @@ describe("Screen.", () => {
122117 } ) ;
123118
124119 const visionAdapterMock = new VisionAdapter ( ) ;
125- const nativeAdapterMock = new NativeAdapter ( ) ;
126120
127- const SUT = new Screen ( visionAdapterMock , nativeAdapterMock ) ;
121+ const SUT = new Screen ( visionAdapterMock ) ;
128122
129123 const imagePath = "test/path/to/image.png" ;
130124 const parameters = new LocationParameters ( customSearchRegion , minMatch ) ;
0 commit comments