Why is mocking useful?
Mocking is the process of simulating parts of the system, meaning they are not production-ready but fake versions that are useful for development and testing.
You may ask yourself, Why do we want to bother with setting a mocked API? There are several benefits of having the API mocked:
- Independence of external services during development: A web application usually consists of many different parts such as the frontend, the backend, external third-party APIs, and so on. When developing our frontends, we want to be as autonomous as possible without getting blocked by some parts of the system that are not functional. If the API of our application is broken or unfinished, we should still be able to proceed with developing the frontend part of the application.
- Good for quick prototyping: Mocked endpoints allow us to prototype the application quicker since they don't require any additional setup such as the backend server, database, and so on. Very...