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)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay