1
- import { VisionAdapter } from "./adapter/vision.adapter.class" ;
2
1
import { AssertClass } from "./assert.class" ;
3
2
import { Region } from "./region.class" ;
4
3
import { ScreenClass } from "./screen.class" ;
5
4
import providerRegistry from "./provider/provider-registry.class" ;
6
5
7
- jest . mock ( 'jimp' , ( ) => { } ) ;
8
- jest . mock ( "./adapter/native.adapter.class" ) ;
9
- jest . mock ( "./adapter/vision.adapter.class" ) ;
6
+ jest . mock ( 'jimp' , ( ) => {
7
+ } ) ;
10
8
jest . mock ( "./screen.class" ) ;
11
9
12
10
describe ( "Assert" , ( ) => {
13
11
it ( "isVisible should not throw if a match is found." , async ( ) => {
14
12
// GIVEN
15
13
ScreenClass . prototype . find = jest . fn ( ( ) => Promise . resolve ( new Region ( 0 , 0 , 100 , 100 ) ) ) ;
16
- const screenMock = new ScreenClass ( new VisionAdapter ( providerRegistry ) ) ;
14
+ const screenMock = new ScreenClass ( providerRegistry ) ;
17
15
const SUT = new AssertClass ( screenMock ) ;
18
16
const needle = "foo" ;
19
17
@@ -26,7 +24,7 @@ describe("Assert", () => {
26
24
it ( "isVisible should throw if a match is found." , async ( ) => {
27
25
// GIVEN
28
26
ScreenClass . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
29
- const screenMock = new ScreenClass ( new VisionAdapter ( providerRegistry ) ) ;
27
+ const screenMock = new ScreenClass ( providerRegistry ) ;
30
28
const SUT = new AssertClass ( screenMock ) ;
31
29
const needle = "foo" ;
32
30
@@ -39,7 +37,7 @@ describe("Assert", () => {
39
37
it ( "isVisible should throw if a match is found." , async ( ) => {
40
38
// GIVEN
41
39
ScreenClass . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
42
- const screenMock = new ScreenClass ( new VisionAdapter ( providerRegistry ) ) ;
40
+ const screenMock = new ScreenClass ( providerRegistry ) ;
43
41
const SUT = new AssertClass ( screenMock ) ;
44
42
const searchRegion = new Region ( 10 , 10 , 10 , 10 ) ;
45
43
const needle = "foo" ;
@@ -56,7 +54,7 @@ describe("Assert", () => {
56
54
it ( "isNotVisible should throw if a match is found." , async ( ) => {
57
55
// GIVEN
58
56
ScreenClass . prototype . find = jest . fn ( ( ) => Promise . resolve ( new Region ( 0 , 0 , 100 , 100 ) ) ) ;
59
- const screenMock = new ScreenClass ( new VisionAdapter ( providerRegistry ) ) ;
57
+ const screenMock = new ScreenClass ( providerRegistry ) ;
60
58
const SUT = new AssertClass ( screenMock ) ;
61
59
const needle = "foo" ;
62
60
@@ -69,7 +67,7 @@ describe("Assert", () => {
69
67
it ( "isVisible should throw if a match is found." , async ( ) => {
70
68
// GIVEN
71
69
ScreenClass . prototype . find = jest . fn ( ( ) => Promise . reject ( "foo" ) ) ;
72
- const screenMock = new ScreenClass ( new VisionAdapter ( providerRegistry ) ) ;
70
+ const screenMock = new ScreenClass ( providerRegistry ) ;
73
71
const SUT = new AssertClass ( screenMock ) ;
74
72
const needle = "foo" ;
75
73
0 commit comments