Testing External Web Requests in Elixir? Roll Your Own Mock Server

Sophie DeBenedetto
Nov 21, 2018 · 7 min read
Image for post
Image for post
Pictured: your very own hand-rolled mock server

Don’t: Use Recorded Requests

Don’t: Mock Web Requests

Do: Build Your Own Mock Server

Building the Mock HTTP Server with Cowboy and Plug

Building the Github API Mock Controller

Cleaner Tests with Our Mock Server

Conclusion



Footer top
Footer bottom

Flatiron Labs

We're the technology team at The Flatiron School (a WeWork…

Sophie DeBenedetto

Written by

Flatiron Labs

We're the technology team at The Flatiron School (a WeWork company). Together, we're building a global campus for lifelong learners focused on positive impact.

Sophie DeBenedetto

Written by

Flatiron Labs

We're the technology team at The Flatiron School (a WeWork company). Together, we're building a global campus for lifelong learners focused on positive impact.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store