New answers tagged

2

E2E testing should be testing without stubbing and then having another layer for testing in isolation where stubbing will be more valuable. For the isolation testing, there may be some instances in which an application sends XHR on page load, so stubbing those requests would be beneficial for execution time.


2

Cypress stub() and spy() are adopted from Sinon.js spies and stubs. Based on Sinon documentation: When to use stubs? Use a stub when you want to: Control a method’s behavior from a test to force the code down a specific path. Examples >include forcing a method to throw an error in order to test error handling. When you want to prevent a ...


Top 50 recent answers are included