@@ -14,12 +14,12 @@ const asymmetricMatcher =
1414 ? Symbol . for ( 'jest.asymmetricMatcher' )
1515 : 0x13_57_a5
1616
17- function isAsymmetricMatcher ( expected : unknown ) : expected is ExpectWebdriverIO . PartialMatcher {
17+ function isAsymmetricMatcher ( expected : unknown ) : expected is ExpectWebdriverIO . PartialMatcher < number > {
1818 return Boolean ( expected && typeof expected === 'object' && '$$typeof' in expected && expected . $$typeof === asymmetricMatcher && 'asymmetricMatch' in expected )
1919}
2020function evaluateResult (
2121 result : ImageCompareResult ,
22- expected : number | ExpectWebdriverIO . PartialMatcher ,
22+ expected : number | ExpectWebdriverIO . PartialMatcher < number > ,
2323 instanceName : string
2424) {
2525 if ( isAsymmetricMatcher ( expected ) ) {
@@ -58,7 +58,7 @@ function isMultiremoteResult(
5858 return typeof result === 'object' && Object . values ( result ) [ 0 ] ?. misMatchPercentage !== undefined
5959}
6060
61- function compareResult ( result : ImageCompareResult , expected : number | ExpectWebdriverIO . PartialMatcher ) {
61+ function compareResult ( result : ImageCompareResult , expected : number | ExpectWebdriverIO . PartialMatcher < number > ) {
6262 const isMultiremote = isMultiremoteResult ( result )
6363 const results = isMultiremote
6464 ? Object . entries ( result as unknown as Record < string , ImageCompareResult > ) . map ( ( [ instanceName , instanceResult ] ) => ( {
@@ -86,7 +86,7 @@ function compareResult (result: ImageCompareResult, expected: number | ExpectWeb
8686
8787function parseMatcherParams (
8888 tag : string ,
89- expectedResult ?: number | ExpectWebdriverIO . PartialMatcher ,
89+ expectedResult ?: number | ExpectWebdriverIO . PartialMatcher < number > ,
9090 options ?: WdioCheckFullPageMethodOptions
9191) {
9292 /**
@@ -125,7 +125,7 @@ function parseMatcherParams (
125125export async function toMatchScreenSnapshot (
126126 browser : WebdriverIO . Browser | WebdriverIO . MultiRemoteBrowser ,
127127 tag : string ,
128- expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher ,
128+ expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher < number > ,
129129 optionsOrUndefined ?: WdioCheckScreenMethodOptions
130130) {
131131 const { expectedResult, options } = parseMatcherParams ( tag , expectedResultOrOptions , optionsOrUndefined )
@@ -136,7 +136,7 @@ export async function toMatchScreenSnapshot (
136136export async function toMatchFullPageSnapshot (
137137 browser : WebdriverIO . Browser | WebdriverIO . MultiRemoteBrowser ,
138138 tag : string ,
139- expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher ,
139+ expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher < number > ,
140140 optionsOrUndefined ?: WdioCheckFullPageMethodOptions
141141) {
142142 const { expectedResult, options } = parseMatcherParams ( tag , expectedResultOrOptions , optionsOrUndefined )
@@ -147,7 +147,7 @@ export async function toMatchFullPageSnapshot (
147147export async function toMatchElementSnapshot (
148148 element : WebdriverIO . Element ,
149149 tag : string ,
150- expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher ,
150+ expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher < number > ,
151151 optionsOrUndefined ?: WdioCheckElementMethodOptions
152152) {
153153 const { expectedResult, options } = parseMatcherParams ( tag , expectedResultOrOptions , optionsOrUndefined )
@@ -159,7 +159,7 @@ export async function toMatchElementSnapshot (
159159export async function toMatchTabbablePageSnapshot (
160160 browser : WebdriverIO . Browser | WebdriverIO . MultiRemoteBrowser ,
161161 tag : string ,
162- expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher ,
162+ expectedResultOrOptions ?: number | ExpectWebdriverIO . PartialMatcher < number > ,
163163 optionsOrUndefined ?: WdioCheckFullPageMethodOptions
164164) {
165165 const { expectedResult, options } = parseMatcherParams ( tag , expectedResultOrOptions , optionsOrUndefined )
0 commit comments