I'm using the new Cypress component test option for my frontend tests, and I absolutely love it. I'm using it as an integration test solution, mounting the root component of my react app and using Cypress to test extensive user interactivity with it. In nearly every way, it's working perfectly, despite its beta status.
For API calls, I'm using the Cypress intercept() feature. Before each test I use intercept to define the mocked API responses I need for the test. It works great.
What I've noticed, however, is if there is an API call that doesn't impact my test, but is still fired in the background, it'll cause a CONREFUSED error. In and of itself, this doesn't really impact my tests, it just outputs the error to the log. However, the completionist in me doesn't like this.
Ideally, I'm hoping there is an option in Cypress where if any CONREFUSED errors occur in an ajax call, it'll fail the test. This may be out of scope for what Cypress offers, and I'm not really sure how to even accomplish it. However, if there is a way, I would love to integrate it into my test suite.