DocFirstFormatter
An ExUnit formatter that always outputs a list of tests, treats pending tests differently from failures, and saves the errors for the end.
Really just a hacked-up ExUnit.CLIFormatter, and I cribbed from RSpec too.
What does it look like?
CoolTest
* passing 1 (0.2ms)
* passing 2 (0.2ms) # this line and the other passing lines are green
* pending (PENDING) # this line is yellow
* failing (0.01ms, FAILED) # this line is red
* passing 3 (0.2ms)
1) test failing (CoolTest)
test/cool_test.exs:13
Assertion with == failed
code: true == false
lhs: true
rhs: false
stacktrace:
test/cool_test.exs:14
Finished in 0.06 seconds (0.06s on load, 0.00s on tests)
5 tests, 1 failure, 1 pendingPlease accept my apologies for
Installation
If available in Hex, the package can be installed as:
-
Add doc_first_formatter to your list of dependencies in
mix.exs:
def deps do
[{:doc_first_formatter, "~> 0.0.1"}]
end-
Ensure doc_first_formatter is configured with ExUnit before starting
ExUnit. In
test/test_helper.exs:
ExUnit.configure formatters: [DocFirstFormatter]
ExUnit.startCode of Conduct
Everyone interacting with this project is expected to follow the code of conduct.
Contributing
Want to make this project better? I'd love to have your help! Both bug reports and patches are extremely valuable.
I've started collecting GitHub issues that are probably easy to fix if you're interested in that.
New issues can be reported either on GitHub or privately.
I'd love to review and accept your pull requests, especially if they're well-tested.