cypress-documentation
cypress-documentation copied to clipboard
Types mismatch between docs and code
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>... whereelementfrom docs isstringtype.
-
for
message; it's only acceptingstringtype, but thetextisPartial<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
Was able to reproduce and created a quick reproduction here. going to route to e2e team and since it should be simple I should have some time to work on it