You can parametrize the code which uses the external libraries by abstracting the libraries APIs using behaviors and making the code depend on modules implementing said behaviors. Then use mox to mock a behvior. If your code depends on Finch, create an HTTP client behavior, mock it with mox and pass it as a dependency to the module which makes the calls. This is one way to test functionality which does side effects.
I would create a module that wraps my interactions with the api. For example, if I were talking with Twitter, I would write a MyApp.TwitterClient module. I would implement it with a Behavior as Mox requires, then in tests replace it with a mock.
In our setup we’re dealing with OAuth a lot, so we need to make sure that we get every details right. The problem with Bypass is that you’re forced to change the URL. We went a similar route to ExVCR, but we’re using Tesla. Here’s our setup:
In :dev, we use our hand-written adapter that records all %Tesla.Env{}s and dumps them to files as request+response pairs,
In :test we feed the recordings to a mock adapter built using Mox.