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 · Fixed by #4170
Closed

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

shlomiassaf opened this issue Mar 25, 2019 · 3 comments · Fixed by #4170
Assignees

Comments

@shlomiassaf
Copy link

shlomiassaf 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
Copy link
Contributor

flotwig 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 cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress labels May 9, 2019
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels May 16, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot 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
Copy link
Contributor

cypress-bot bot 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants