December 2021
Intermediate to advanced
510 pages
11h 20m
English
Testing your API client by connecting to the real API is hard because you don’t always have full control over the API or the network. Even testing on your local server can be tricky because each test can impact the next. On a real live API, it’s even harder to ensure the tests are reproducible. You may also be unable to test error conditions such as invalid responses or empty lists.
In addition, it’s not nice to hit someone else’s server to test your code, especially if this is part of an automated test pipeline that runs periodically, for example, when using a continuous integration platform.
To overcome these challenges, you mock the API locally for your tests, simulating the expected responses ...
Read now
Unlock full access