EDIT: I came up with a even better way to debug Elixir code than using
iex, check it here.
Interactive Driven Development, or REPL Driven Development is a really good way to approach programming, specially for developers that get distracted easily with time being expend out the main development loop or flow.
A way to do it in Elixir is just to use the
fswatch as presented in Elixir Mix Test documentation, or using the excellent mix.test-watch library, but them don't work well with
iex, the Elixir REPL, so why not do something else.
So I created some modules that can be imported on your
iex through the
~/.iex.exs file and get the same benefits.
Just insert it on your
And create a
~/.iex directory, placing this file on it:
There is an explanition about how to use it on the
@moduledoc, but briefly you just need to call
iex prepending the
~/.iex directory on the Elixir path:
ELIXIR_ERL_OPTIONS="-pa $HOME/.iex" MIX_ENV=test iex -S mix
IExWatchTests.Helpers that is imported on
~/.iex.exs allows to call
a to run failed, stale and all tests respectively.
You can call
w to watch tests and
uw to unwatch.
There is a really simple throttle mechanism that disallow run the suite concurrently.
That is all. Enjoy!