|
|
|
|
|
by apwell23
331 days ago
|
|
> I truly know the API is going to do what it says or what I think it says without actually calling the API? what if the API changes all of sudden in production? what about cases where api stays the same but content of response is all wrong? how do tests protect you from that? edit: they are not hypothetical scenarios. wrong responses are way more common than schema breaking. tooling upsteam is often pretty good at catching schema breakages. wrong responses often cause way more havoc than schema breakages because you get an alert for schema failures in app anyways. |
|
For your example, the best place to invest would be in that API's own test suite (e.g. sending its devs examples of usage that we rely on); but of course we can't rely on others to make our lives easier. Contracts can help with that, to make the API developers responsible for following some particular change notification process.
Still, such situations are hypothetical; whereas the sorts of integration tests that the parent is describing are useful to avoid our deployments from immediately blowing up.