Mock
A stand-in object or service that simulates the behavior of a real dependency to test a component in isolation.
What is Mock?
What is Mock?
A mock is a controlled substitute for a real dependency—an API, a service, a database—that returns predetermined responses so the code under test can be exercised in isolation, quickly and deterministically. Mocks let you simulate scenarios that are hard to trigger for real, like specific error responses or slow networks, and they remove flakiness caused by unreliable external systems. Playwright's request interception can mock network responses inside a browser test, letting recorded flows validate how the UI reacts to any backend condition you choose.