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

fix: remove deprecated cy.state('subject') #230

Conversation

warpdesign
Copy link

What:

Replace cy.state('subject') by cy.currentSubject().

Why:

cy.state('subject') is being deprecated:

image

How:

Replace cy.state('subject') by cy.currentSubject() in utils.ts.

Checklist:

  • Documentation N/A
  • Tests
  • Ready to be merged

Copy link

@exc304 exc304 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the clean up here. Curious about cy.within - would this need to be reviewed/updated too?

@skvale
Copy link

skvale commented Sep 14, 2022

Linking the PR that deprecated this: cypress-io/cypress#23092

While we would normally consider internal state to be internal, cypress-testing-library relies on cy.state('subject'). Therefore, this PR includes a shim to keep that call working as before. Once this PR is released, we will follow up with them to move over to the new call, ensuring that no end users (with or without cypress-testing-library) ever experience disruption (beyond the console warning).

@TylorMayfield
Copy link

image
My console appreciates it

@marctorrelles
Copy link

Hi! Do you think we can get this merged? Thanks 😄

@olaj
Copy link

olaj commented Nov 11, 2022

It would be awesome if this gets merged, if it works that is.

@NicholasBoll NicholasBoll added the duplicate This issue or pull request already exists label Nov 15, 2022
@NicholasBoll
Copy link
Contributor

Duplicate of #233

@NicholasBoll NicholasBoll marked this as a duplicate of #233 Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants