How To Mock Functions That Have External HTTP Requests
<p>When writing tests, we do not want to hit the external API each time we run our tests. If we are coming from a dynamic language, such as Node.JS, we may want to a solution like <a href="https://www.npmjs.com/package/fetch-mock">fetch-mock</a> which will patch the implementation of <code>fetch</code> at runtime. This is not practical in Rust. There are some attempts, like the <a href="https://github.com/Shizcow/hotpatch">hotpatch</a> crate, but we will use a different strategy.</p>