View Source Bonfire.Common.Test.Interactive (Bonfire v0.9.10-classic-beta.169)
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.
Summary
Functions
Returns a specification to start this module under a supervisor.
Sets up database options for tests
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Sets up database options for tests
You can tell a specific test to not wrap in a transaction and rollback with:
@tag db_sandbox: false