How to debug ExUnit test:

Normaly when you want to run your elixir/phoenix tests you run it with:

mix test

If you want to debug Elixir code in middle of test execution you can place this inside your elixir file:

# ...
require IEx; IEx.pry
# ...

…and run your tests with:

iex -S mix test

How to debug Phoenix in development:

You can actually do this with development code to and run your Phoenix server iex -S mix phoenix.server. Then you can debug directly from the terminal where you run the server.

Relevant Blogs