- during development, you won't need to start locally all the services your app depends on (especially useful when your backend is a fleet of microservices)
- during development, you won't need to rely on remote services (you can work offline!)
- you can easily simulate all of your API responses and corner cases
- you can get an idea of all the APIs your app calls just by looking into the
mock-server
directory
mock-server
is much more flexible (non-json / non REST APIs, simulate error
conditions, etc), but much more manual (you need to write your own route
handlers).
Again, mock-server
is more flexible, but more manual. Also, mock-server
has
a simpler approach which might be easier to use.
service-mocker
has an entirely different approach, implementing the mock
server in a service worker. While this might be useful in some scenarios, it
certainly complicates things a bit. Also, mock-server
is a bit more
high-level, enforcing/providing a convention to write route handlers.
Mock Server and WireMock
mock-server
is much more primitive than Mock Server and WireMock, but also
much simpler to use. Moreover, since mock-server
is a nodejs app, it's
probably easier to integrate in your existing frontend development
workflow/environment.