Open
Description
Current behavior
When trying to override the type
method in typescript, I got errors from typescript linter. It's 1:1 copy and paste from docs .
I get 3 errors.
- for
$el
; it's only acceptingJQuery<HTMLElement>
... whereelement
from docs isstring
type.
- for
message
; it's only acceptingstring
type, but thetext
isPartial<Cypress.TypeOptions>
type.
- for
originalFn
; it's accepting 1-2 arguments, but docs says to pass options as 3rd argument
Desired behavior
Docs tips should match the actual code typing
Test code to reproduce
Cypress.Commands.overwrite('type', (originalFn, element, text, options = {}) => {
if (options.maskLog) {
options.log = false;
Cypress.log({
$el: element,
name: 'type',
message: '*'.repeat(text.length),
});
}
return originalFn(element, text, options);
});
Cypress Version
10.10.0
Node version
v16.13.2
Operating System
MacOS 12.6
Debug Logs
No response
Other
No response