4 ms·
If we're talking about mocking in general, mocking foreign services might be very useful and may be even essential for good development practices. For example i
by vbezhenar 4y ago
If we're talking about mocking in general, mocking foreign services might be very useful and may be even essential for good development practices. For example imagine that you're integrating with some other system. You might receive some test credentials during development time, but they'll lost eventually or something will break. So you'll have production integration, but no way to properly develop your code. So I'm always writing some emulator for foreign services. It might be as simple as mocked responses or it might contain its own little database and some primitive logic. But in the end you don't depend on someone's test system, you can run your integration tests, you can run your staging environment and so on.
That might not be necessary if you're integrating with some big guys like stripe or facebook. They probably have enough resources to maintain test environments. But for some little company which don't really care about test environments and whether it corresponds to the production environment - that kind of mocking might be necessary for sanity.