Commoner - Elixir wrapper for Common Test library

I recently started working with pure Erlang and when I got back to Elixir there was one thing that I was truly missing - Common Test, which is Erlang’s library for testing. It is much more powerful than ExUnit, mostly because these two targets completely different use cases - ExUnit focus on unit tests (which makes it (better) equivalent to EUnit) and Common Test focus on integration and large scale testing (potentially with mutable state). So as I was missing Common Test I have started wrapper library (very early stage of the work) mostly to check if I would be able to provide better UI.

What I have achieved so far can be checked on GitHub repo.

Example test suite with current API:

defmodule MyApp.TestsSuite do
  use CommonTest.Suite

  test "pass" do
    assert 1 + 1 == 2
  end

  test "fail" do
    assert 2 + 2 == 5
  end
end

TODO

  • Support for test groups
  • Better error display
  • More assertions (currently supports only assert/1-3)
  • Documentation
  • Better tests runner
  • Support for handling configuration

I would like to hear what do you think about the current API and your ideas how should the final API look like.

8 Likes