How To Create Test Server for External Service Testing?

I want to do something like https://golang.org/pkg/net/http/httptest/#example_Server
to stub a http response when the module or function can’t be mocked.

You can see in golang doc, that I can have ts.URL() to replace my external service URL, hence I can do response stubbing easily.

Is there any way doing in elixir? Or similar libraries?

I use bypass in such cases (unless I misunderstood your question), take a look at it https://github.com/PSPDFKit-labs/bypass

That might be it, I’ll take a look.

Thank you!