cypress-documentation
cypress-documentation copied to clipboard
docs(cy.stub): Update syntax to use callsFake() instead of deprecated third argument
While using Cypress, I encountered a deprecated notice when following the official documentation for cy.stub(object, method, replacerFn). Upon investigation, I found that this syntax has been deprecated in Sinon.JS since version 3.0.0. As Cypress is currently using Sinon.JS version 7.3.2(as per package.json), I determined that this was a deprecated specification.
So I made changes in document:
- Removed the deprecated
cy.stub(object, method, replacerFn)syntax from the documentation. - Updated related examples to use the new recommended syntax
cy.stub(object, method).callsFake(replacerFn).
These changes will help Cypress users write more up-to-date and future-proof test code, avoiding potential deprecation warnings or errors.
Please review and let me know if any further changes or clarifications are needed.
Deploy request for cypress-docs pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | 87faf51cc8410eee9c6fdf29a853497175a701b3 |
- Create a Draft Pull Request if your PR is not ready for review. Mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR.
- This PR seems to be an duplicate of PR https://github.com/cypress-io/cypress-documentation/pull/5592 (which apparently was never reviewed).
I didn't see that! I'll close this.