DEV Community

Srikanth Kyatham
Srikanth Kyatham

Posted on

2 2

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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay