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

shlomiassaf opened this issue Mar 25, 2019 · 3 comments

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

shlomiassaf opened this issue Mar 25, 2019 · 3 comments


Copy link

@shlomiassaf 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.

Copy link

@flotwig 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.

Copy link

@cypress-bot 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.

Copy link

@cypress-bot 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants