After updating from wdio v5 to wdio v6 (6.11.0 with "typescript": "^4.2.2"), I started getting the below error on browser.executeAsync(runCheck, v1)
error TS2345: Argument of type ‘(v1: number, callback: Function) => Promise<void>'
is not assignable to parameter of type 'string | ((arguments_0: number) => void)'.
Below is my code:
const runCheck = async (
v1: number,
callback: Function
): Promise<void> => {
...
...
...
callback(v1);
};
const canReceive = (
browser: WebdriverIO.BrowserObject,
): boolean => {
const v1 = 50;
const rate = browser.call(() =>
browser.executeAsync(runCheck, v1)
);
return rate > 10;
};
I have tried modifying
Promise<void> to Promise<any>
but doesn't seem to help. Any points on how to fix the issue is appreciated.
Thank you in advance.