Skip to content

Files

Latest commit

31a58d5 · Oct 12, 2023

History

History

stubbing-spying__functions

README.md

stubbing-spying__functions

Shows how to control dependencies during tests using cy.spy and cy.stub

Shows how to load application code directly from the spec code and shows how to:

  • use cy.spy() to assert that expected calls were made
  • use cy.stub() to replace actual methods calls with synthetic responses
  • Handle promises returned by stubbed functions.
  • Handle callbacks in stubbed functions.

See