cypress-documentation icon indicating copy to clipboard operation
cypress-documentation copied to clipboard

docs(cy.stub): Update syntax to use callsFake() instead of deprecated third argument

Open sadie100 opened this issue 1 year ago • 3 comments

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:

  1. Removed the deprecated cy.stub(object, method, replacerFn) syntax from the documentation.
  2. 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.

sadie100 avatar Oct 17 '24 08:10 sadie100