I just added a `test/support` directory and `test/support/data_case.ex` to
my Mix application. When I tried to `use MyApp.DataCase`, I got a
`CompileError` like `module MyApp.DataCase is not loaded and could not be
found`.
This confused me for a moment, because I clearly had the right name. After
a few minutes, I realized the problem: `test/support` was not part of my
`elixirc_paths` in `Mix.exs`. I needed:
def project do
[
...
elixirc_paths: elixirc_paths(Mix.env()),
...
]
end
and
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
I don't know if it's a common cause, but perhaps this error could be made
friendlier with a hint like "current `elixirc_paths` are..."?
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/4dcf2571-976e-4fb4-8fd4-58b8cc0508b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.