Viewing your test coverage in Elixir
Curious about test coverage in your Elixir application? Mix.Tasks.Test
comes with a handy --cover
option.
$ mix test --cover
...
Generating cover results ...
Percentage | Module
-----------|--------------------------
...
100.00% | TilexWeb.PixelController
75.00% | Mix.Tasks.Deploy
30.00% | TilexWeb
...
-----------|--------------------------
68.33% | Total
By default it uses a wrapper around OTPs built in cover
, however that's configurable. If you wanted to use something like excoveralls you could:
def project() do
[
...
test_coverage: [tool: ExCoveralls]
...
]
end
Other niceties, like color based thresholds, can be found in the docs
Tweet