ExUnit test_helper.exs usage
Srikanth Kyatham

Srikanth Kyatham @srikanthkyatham

About: Software engineer interested in building stuff

Location:
Oulu, Finland
Joined:
Jun 21, 2020

ExUnit test_helper.exs usage

Publish Date: Apr 15 '21
4 0

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.

Comments 0 total

    Add comment