In my Elixir/Phoenix app, when I run
mix test
I get output like:
$ mix test
....
Finished in 0.09 seconds
4 tests, 0 failures
with dots for each test that succeeded.
How do I output the names of the tests that succeed instead?
In Rails with rspec I used to do this with a .rspec file in the directory that looked like:
$ cat .rspec
--color
-fd
--tty
Is there an equivalent in Elixir?
To print the names of the passing tests, you can pass
--trace
argument tomix test
. For example, here's the output ofmix test --trace
on the current master branch ofhttpoison
package:You can also set this option to true by default by changing the
ExUnit.start
line intest_helper.exs
:If you want completely custom output, you can implement your own formatter (see https://github.com/elixir-lang/elixir/blob/master/lib/ex_unit/lib/ex_unit/cli_formatter.ex for an example; that's the default formatter) and configure ExUnit to use it:
--trace
is the option you're looking for: https://hexdocs.pm/mix/Mix.Tasks.Test.htmlHope that helps!