Stub an API Request Status Code and Error Message with cy.intercept

InstructorFilip Hric

Share this video with your friends

Send Tweet

Frontend application can react differently to various server responses. One way to test the application behavior is to change response status code. .intercept() command in Cypress has the ability to stub the status code and error message that the server would provide on error.