-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Pre-check
- I know I can edit the docs but prefer to file this issue
Describe the improvement
Unclear documentation
Description of the improvement / report
Currently, the docs for extending WDIO's expect with a custom matcher only use JavaScript as an example.
While following these docs does work, TypeScript users will run into compiler errors. This is because the normal method for extending the expect type does not seem to have any effect on the expect from expect.webdriverio:
declare module 'expect' {
interface AsymmetricMatchers {
toBeWithinRange(floor: number, ceiling: number): void;
}
interface Matchers<R> {
toBeWithinRange(floor: number, ceiling: number): R;
}
}error TS2339: Property 'toBeWithinRange' does not exist on type 'Matchers<void, number>'
It would be nice if the docs included a snippet for TypeScript users demonstrating how to properly extend the type for expect when extending it with custom matchers.
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable