elixirex-unit

How to send test results to another place on elixir


When I run mix test I get all the results back in the shell. How can I get the results to more places like slack, files etc..?


Solution

  • I found answer for my question in https://stackoverflow.com/a/41350442/11678286. To config your own configuration for ExUnit results I need to implement my 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:

    ExUnit.start(formatters: [YourFormatterModule])

    For send the result to other places (like slack) I just need to copy the default formatter and add function there that send it to salck too.