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

Deploy request for cypress-docs pending review.

Visit the deploys page to approve it

Name Link
Latest commit 87faf51cc8410eee9c6fdf29a853497175a701b3

netlify[bot] avatar Oct 17 '24 08:10 netlify[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 17 '24 08:10 CLAassistant

cypress-app-bot avatar Oct 17 '24 08:10 cypress-app-bot

  • This PR seems to be an duplicate of PR https://github.com/cypress-io/cypress-documentation/pull/5592 (which apparently was never reviewed).

MikeMcC399 avatar Nov 12 '24 15:11 MikeMcC399

I didn't see that! I'll close this.

sadie100 avatar Nov 13 '24 00:11 sadie100