cypress-testing-library icon indicating copy to clipboard operation
cypress-testing-library copied to clipboard

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

Open warpdesign opened this issue 3 years ago • 2 comments

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
  • [x] Tests
  • [x] Ready to be merged

warpdesign avatar Sep 06 '22 15:09 warpdesign

Linking the PR that deprecated this: https://github.com/cypress-io/cypress/pull/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).

skvale avatar Sep 14 '22 14:09 skvale

image My console appreciates it

TylorMayfield avatar Oct 06 '22 18:10 TylorMayfield

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

marctorrelles avatar Nov 04 '22 18:11 marctorrelles

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

olaj avatar Nov 11 '22 14:11 olaj

Duplicate of #233

NicholasBoll avatar Nov 15 '22 18:11 NicholasBoll