Fail tests if external (HTTP) apis are called

I was wondering if there is an easy automated way to do this. We have a test suite that we run and we mock out external API calls for obvious reasons. But sometimes something does not get mocked like it should. It would be wonderful if there was a way to automatically catch that across our test suite.

Is there a solution for this? My google-fu failed me

Thanks! :smiley:

I don’t know of any way to do this automatically through code but could you just turn your networking off and see what fails?

I usually use fake API info to configure the test env so if a request goes out because the API module wasn’t mocked it fails obviously.