Creating mocks is easy. Keeping them aligned with real APIs is the hard part.

Most teams think creating mocks is the hard part.
It isn't.
The hard part is keeping mocks aligned with reality.
A frontend team creates a mock response. Development moves forward. Weeks later, the real API changes. A field disappears, a type changes, or a nested structure evolves.
The mock continues to work.
The tests continue to pass.
Production eventually breaks.
This phenomenon is called contract drift.
Contract drift occurs when the behavior or structure of a real API changes while the mock, tests, or consuming applications continue to assume the old contract.
Common examples:
A field is removed
A data type changes
A required field becomes optional
A nested object changes structure
The dangerous part is that nothing immediately fails.
Your mock still returns the expected response.
Your frontend tests still pass.
Your QA environment still looks healthy.
Meanwhile, the real API has already moved on.
Tools like:
MSW
Postman Mocks
Mockoon
json-server
are excellent at creating mocks.
But they generally don't answer a more important question:
Does my mock still match reality?
And that's where many teams get caught off guard.
0
0
0