View Source mix ex_unit_ext.test (ExUnitExt v0.1.0-alpha.0)

A wrapper for mix test.

To use ex_unit_ext.test, it is recommended to add the alias test: ex_unit_ext.test to mix.exs and run tests with mix test as usual.

# mix.exs
defmodule My.MixProject do
  use Mix.Project

  def project do
    [
      ...
      aliases: [test: "ex_unit_ext.test"]
    ]
  ...
end

The wrapper supports all options of the mix test task.

When you run your test suite, it prints results as they run with a summary at the end. The test suite will print a 'sign' for each test. Successful tests are represented by a green ., failed tests by a red ?, skipped tests by a yellow * and invalid tests by a magenta ?.

$ mix test --no-color
Running ExUnit with seed: 450686, max_cases: 16

??*.!...

  1) test greets the community (MyAppTest)
     test/my_app_test.exs:22
     Assertion with == failed
     code:  assert MyApp.hello() == :community
     left:  :world
     right: :community
     stacktrace:
       test/my_app_test.exs:23: (test)

  2) MyApp.FooTest: failure on setup_all callback, all tests have been invalidated
     ** (RuntimeError) setup_all fails
     stacktrace:
       test/my_app_test.exs:31: MyApp.FooTest.__ex_unit_setup_all_0/1
       test/my_app_test.exs:27: MyApp.FooTest.__ex_unit__/2

Finished in 0.02 seconds (0.00s async, 0.02s sync)
1 doctest, 7 tests, 1 failure, 2 invalid, 1 skipped

Command line options

All mix test commans line options are supported.

The following options are provided by ExUnitExt:

  • --theme - specify the theme for the output. Available themes are: "ext", "block" and "hearts".