Server-Side Mocking
Server-side mocking intercepts HTTP requests made by your application server (for example, API calls during server-side rendering) and replaces them with mocked responses.

- A test defines mock schemas and sends them to the app server in a custom HTTP header:
x-mock-request. - A server-side interceptor reads that header and applies the mocks to the outgoing API calls.
- The page is rendered with mocked data, and the test asserts the expected UI state.
Server-side mocking requires two pieces of setup:
- Framework integration — installs the interceptor that reads the header and captures outgoing requests on the server.
- Test runner integration — sends the mock header from your tests to the app server.
To mock requests made directly in the browser, see Client-Side Mocking.