Related Tech
Before listing alternatives to Mockaton, lets summarize its differentiators besides the dashboard.
Why Mockaton is best overall?
No vendor lock-in
By design, it doesn't live in your code. There’s no need to write code to integrate it.
It’s a real server
It‘s not limited to browsers, and in browsers it doesn‘t have the limitations Service Worker alternatives have. For example, you can test cookies and anticipate CORS problems. Also, you don‘t have to write exclusion rules for requests that aren‘t related to your API.
By the same token, you can change API states without risking your frontend state.
Privacy and security
- Zero dependencies, which mitigates the common supply chain attacks on the NPM ecosystem.
- Does not hijack your browsers' requests (it’s not a Service Worker).
-
Does not write to disk. Except when you select ✅ Save Mocks
for scraping mocks from a backend, or when you add mocks via the API.
Both can be disabled by
config.readOnly. Also, writes are limited to theconfig.mocksDir. - Does not initiate network connections (no logs, no telemetry).
Auditable and easy to modify and maintain
The code is organized and small. The server is under 2 KLoC.
Alternatives
Proxy-like
These are similar to Mockaton in the sense that you can modify the mock response without losing or risking your frontend code state. For example, if you are polling, and you want to test the state change.
- Chrome DevTools allows for overriding responses.
- Reverse Proxies such as Burp are also handy for overriding responses. Not easy but very powerful.
- mimtproxy
- HTTP Toolkit
- Proxyman
- Charles Proxy
Server side
Client side (Service Worker)
Mockaton has a sister testing library Pixaton for testing UI regression by taking screenshots and pixel diffing them. Give it a try too, it’s also open source, and runs locally and much faster than commercial alternatives. Like 12 times faster.
Having said that, many teams use MSW, so they can use Storybook, so they can use an expensive and slow screenshot SASS. In those cases, keep in mind that you can organize your mocks in a directory structure that mimicks your API endpoints. That way you can use Mockaton and MSW side-by-side.