Skip to content

EirikBirkeland/cypress-example-stubbed-api

Repository files navigation

This little example shows how to stub an XHR request with Cypress.

The code to be tested makes an XHR request to localhost:3000. This request is then intercepted and stubbed with cy.server and cy.route. This way, the code can be tested as a unit, without requiring you to spin up an actual server.

This approach makes for fast testing! Animation

About

Stubbing XHR requests with Cypress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published