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 for Cypress.Commands.overwrite are incorrect - does not take command options #5341

Closed
CSchulz opened this issue Oct 10, 2019 · 4 comments · Fixed by #5347
Closed

Types for Cypress.Commands.overwrite are incorrect - does not take command options #5341

CSchulz opened this issue Oct 10, 2019 · 4 comments · Fixed by #5347

Comments

@CSchulz
Copy link

CSchulz commented Oct 10, 2019

Current behavior:

    Commands: {
      add(name: string, fn: (...args: any[]) => void): void
      add(name: string, options: CommandOptions, fn: (...args: any[]) => void): void
      overwrite(name: string, fn: (...args: any[]) => void): void
      overwrite(name: string, options: CommandOptions, fn: (...args: any[]) => void): void
    }

Desired behavior:

    Commands: {
      add(name: string, fn: (...args: any[]) => void): void
      add(name: string, options: CommandOptions, fn: (...args: any[]) => void): void
      overwrite(name: string, fn: (...args: any[]) => void): void
    }

Steps to reproduce: (app code and test code)

overwrite: (name, fn) ->
storeOverride(name, fn)

Versions

3.4.1

@jennifer-shehane jennifer-shehane changed the title Cypress.Commands.overwrite does not take command options Types for Cypress.Commands.overwrite are incorrect - does not take command options Oct 10, 2019
@jennifer-shehane
Copy link
Member

@CSchulz Yeah, this seems to be completely true, which means the docs are incorrect as well. https://on.cypress.io/custom-commands#Syntax

I created a new issue in our docs to document the options not being available during overwrite here: cypress-io/cypress-documentation#2147.

@jennifer-shehane
Copy link
Member

I've opened a PR to fix the typings here: #5347

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2019

The code for this is done in cypress-io/cypress#5347, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 23, 2019

Released in 3.5.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants