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.