Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types mismatch between docs and code #5518

Open
403-html opened this issue Oct 13, 2022 · 1 comment
Open

Types mismatch between docs and code #5518

403-html opened this issue Oct 13, 2022 · 1 comment
Labels
E2E triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug

Comments

@403-html
Copy link

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.

  1. for $el; it's only accepting JQuery<HTMLElement>... where element from docs is string type.

image

  1. for message; it's only accepting string type, but the text is Partial<Cypress.TypeOptions> type.

image

  1. for originalFn; it's accepting 1-2 arguments, but docs says to pass options as 3rd argument

image

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

@AtofStryker
Copy link
Contributor

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

@nagash77 nagash77 added E2E triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. labels Apr 19, 2023
@jennifer-shehane jennifer-shehane transferred this issue from cypress-io/cypress Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug
Projects
None yet
Development

No branches or pull requests

3 participants