diff --git a/src/matchers/mock/toBeRequestedWith.ts b/src/matchers/mock/toBeRequestedWith.ts index ad55a5eb4..2988b4012 100644 --- a/src/matchers/mock/toBeRequestedWith.ts +++ b/src/matchers/mock/toBeRequestedWith.ts @@ -353,7 +353,7 @@ const shortenJson = ( keyLimit = KEY_LIMIT ): ExpectWebdriverIO.JsonCompatible => { if (JSON.stringify(obj).length < lengthLimit) { - return obj as ExpectWebdriverIO.JsonCompatible + return obj } if (Array.isArray(obj)) { diff --git a/src/utils.ts b/src/utils.ts index ad2d8bb19..5d7f9f876 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -186,7 +186,6 @@ export const compareText = ( } } - expected = expected as string | RegExp if (expected instanceof RegExp) { return { value: actual,