😲 Test breakpoints? New in Elixir 1.17 ✨

Notes

Elixir 1.17 shipped with a new feature that lets us put breakpoints right into our tests!

All we have to do is run them in the context of iex and pass the --breakpoints flag (or -b):

$ iex -S mix test test/path/to/file.exs -b

You’ll be dropped into the test inside a breakpoint.

There you can evaluate any local variables and imported functions (seems like not local functions though).

Now n will step inside the text to the next line, and c will take you to the next test.

It’s a really nice trick if you want to confirm that your test setup is what you think it is. 😅 Keep it handy.

Want the latest Elixir Streams in your inbox?

    No spam. Unsubscribe any time.