Skip to content

breaking: Remove deprecated cy.stub(obj, method, fn) signature #31548

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

Open
wants to merge 8 commits into
base: release/15.0.0
Choose a base branch
from

Conversation

jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Apr 18, 2025

Additional details

This signature was removed from sinon in v3. This removes the signature that we deprecated long ago in cy.stub.

This did require some updates in places where we were still using it, so could break some users.

Steps to test

Test pass. Using cy.stub(obj, method, fn) should no longer work properly.

How has the user experience changed?

There would be TypeScript errors for TS users using this signature.

It looks like the stub will just silently not apply with the updates. Here's an example of using the old signature - the assertion now fails since the stub wasn't properly applied.

Screenshot 2025-04-21 at 11 59 38 AM

PR Tasks

@jennifer-shehane jennifer-shehane changed the base branch from develop to release/15.0.0 April 18, 2025 18:13
@jennifer-shehane jennifer-shehane self-assigned this Apr 18, 2025
Copy link

cypress bot commented Apr 18, 2025

cypress    Run #61803

Run Properties:  status check passed Passed #61803  •  git commit bc6683b6ad: Merge branch 'release/15.0.0' into remove-deprecated-cy-stub-sig
Project cypress
Branch Review remove-deprecated-cy-stub-sig
Run status status check passed Passed #61803
Run duration 27m 31s
Commit git commit bc6683b6ad: Merge branch 'release/15.0.0' into remove-deprecated-cy-stub-sig
Committer Jennifer Shehane
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 9
Tests that did not run due to a developer annotating a test with .skip  Pending 1099
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 26569
View all changes introduced in this branch ↗︎
UI Coverage  46.31%
  Untested elements 184  
  Tested elements 163  
Accessibility  92.63%
  Failed rules  3 critical   8 serious   2 moderate   2 minor
  Failed elements 887  

@jennifer-shehane jennifer-shehane requested review from AtofStryker and removed request for AtofStryker April 21, 2025 16:01
@mschile mschile requested a review from cacieprins April 22, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deprecated cy.stub signature
1 participant