Blog & Stuff

Contract Testing

Sometimes we need to make sure external APIs have not changed. Some of those we have control over some of those we do not.

Either way we can run tests daily, weekly or as needed, outside of our tests we run with every push to Github, that will make sure this API is still delivering what we expect.

This video gave me some good tips on this one being to keep your Contract tests outside of your Domain Logic. Secondly to focus on the KEYS and VALUES you care about.

KEYS

Focusing on the ones you care about can make this a ton easier. If I am calling an API and only want to know the ID and TITLE then I am going to make sure those exist and are in the same place every time.