View Source Bonfire.Common.Test.Interactive (bonfire v0.3.5-classic-beta.10)

This utility allows to get the same effect of using fcwatch | mix test --stale --listen-on-stdin to watch for code changes and run stale tests, but with more control and without the starting time penalty.

Note that watching requires fswatch on your system. Eg on Mac run brew install fswatch.

To use it, in your project's .iex file add:

unless GenServer.whereis(Bonfire.Common.Test.Interactive) do
  {:ok, pid} = Bonfire.Common.Test.Interactive.start_link()
  # Process will not exit when the iex goes out
  Process.unlink(pid)
end
import Bonfire.Common.Test.Interactive.Helpers

Then to call iex and run tests just do:

MIX_ENV=test iex -S mix

The Bonfire.Common.Test.Interactive.Helpers allows to call f and s and 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 mecanism that disallow running the suite concurrently.

Link to this section Summary

Link to this section Functions