pspdfkit-labs/bypass ? reverse-engineered prompt

Reverse engineered prompt

Build me an Elixir test helper that makes it easy to stand in for a real HTTP server during tests.

I want to be able to open a local mock server on a random port, point my client at it, and then define what it should return for certain requests. It should support simple generic responses, route specific responses by method and path, and also one time expectations so I can verify a request was actually made. I also want a way to use the same server for multiple tests at once, and to simulate the server going down and coming back up so I can test reconnect behavior.

Please make it feel very easy to use in ExUnit, with automatic cleanup after each test, and if possible, let me turn on debug logging when I need to see what it is doing. If you need to check the current Elixir testing docs or Plug details, look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab