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

expose isCy ("publicly") in docs and typescript defs #3822

Closed
shlomiassaf opened this issue Mar 25, 2019 · 3 comments

Comments

3 participants
@shlomiassaf
Copy link

commented Mar 25, 2019

Current behavior:

cy,isCy is exposed physically at runtime but it's not documented and it does not appear is the typescript type definitions.

Desired behavior:

cy.isCy should be exposed in the docs and in TS typings so we know it's officially public and safe to use.

I found that cypress-pipe is using it and perhaps others as well...

Typescript signature should be something like this:

    interface Chainable {
      isCy<TSubject = any>(obj: Chainable<TSubject>): obj is Chainable<TSubject>;
      isCy(obj: any): obj is Chainable<any>;
    }

This will allow typescript to infer TSubject when possible while allowing non Chainable types to passthrough without complaints.

@flotwig

This comment has been minimized.

Copy link
Member

commented May 9, 2019

This should be exposed, but it should be exposed on Cypress.isCy(), since it doesn't return a chainable like all the other cy. commands do.

@cypress-bot

This comment has been minimized.

Copy link

commented May 16, 2019

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

@cypress-bot

This comment has been minimized.

Copy link

commented May 17, 2019

Released in 3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.