Skip to content

Commit 6ab5de6

Browse files
committed
(#329) Remove leftover string type checks
1 parent b61b723 commit 6ab5de6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/assert.class.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class AssertClass {
88
}
99

1010
public async isVisible(needle: FirstArgumentType<typeof ScreenClass.prototype.find>, searchRegion?: Region, confidence?: number) {
11-
const identifier = (typeof needle === "string") ? needle : (await needle).id;
11+
const identifier = (await needle).id;
1212

1313
try {
1414
await this.screen.find(
@@ -27,7 +27,7 @@ export class AssertClass {
2727
}
2828

2929
public async notVisible(needle: FirstArgumentType<typeof ScreenClass.prototype.find>, searchRegion?: Region, confidence?: number) {
30-
const identifier = (typeof needle === "string") ? needle : (await needle).id;
30+
const identifier = (await needle).id;
3131

3232
try {
3333
await this.screen.find(

lib/expect/matchers/toShow.function.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ export const toShow = async (
1212
locationParams = new LocationParameters();
1313
locationParams.confidence = confidence;
1414
}
15+
const identifier = (await needle).id;
1516
try {
1617
await received.find(needle, locationParams);
1718
return {
18-
message: () => `Expected screen to not show ${needle}`,
19+
message: () => `Expected screen to not show ${identifier}`,
1920
pass: true,
2021
};
2122
} catch (err) {
2223
return {
23-
message: () => `Screen is not showing ${needle}: ${err}`,
24+
message: () => `Screen is not showing ${identifier}: ${err}`,
2425
pass: false,
2526
};
2627
}

0 commit comments

Comments
 (0)