DEV Community

Srikanth Kyatham
Srikanth Kyatham

Posted on

ExUnit test_helper.exs usage

Hi

To load additional modules into the mix test, add the path of the modules in the mix.exs. In the below example I am adding "test/helpers" path to the elixirc_paths

def project do
  [
    ...
    elixirc_paths: elixirc_paths(Mix.env())
  ]
end

defp elixirc_paths(:test), do: ["lib", "test/support", "test/helpers"]
defp elixirc_paths(_), do: ["lib"]

Enter fullscreen mode Exit fullscreen mode

Then all the modules defined in "test/helpers" will be available to tests.

Top comments (0)