This is the fifth part of our 12-day Advent of Monitoring series. In this series, Checkly's engineers will share practical monitoring tips from their own experience.`
The challenge of simulating user experiences in testing while avoiding external and unpredictable elements such as third-party modules and APIs is a significant headache for developers. To tackle this issue, the team adopts a user-centric approach by faking or mocking API calls and libraries for unit tests, and using route interception to bypass loading of marketing tools during end-to-end testing. By preemptively mocking all potential external request failures, they avoid potential issues and achieve a spotless record in their monitoring checks. However, there is still some upkeep required to keep the regex expressions up-to-date, and an issue with report clutter remains to be addressed. The team's experience highlights the importance of using modern testing tools like Playwright and its versatile mocking capabilities.