def project do
[
...
elixirc_paths: elixirc_paths(Mix.env()),
...
]
end defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]--
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 elixir-lang-core+unsubscribe@googlegroups.com.
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.
Hi Nathan!The issue is that the compiler is just one of many ways where we can define modules in Elixir. Maybe you expected this module to be define in your test_helper and you have a type in the module name. The module could also have come from a dependency and you had a typo in its name when using it.I think ultimately pointing towards elixirc_paths would be misleading.
On Wed, May 9, 2018 at 11:25 PM, Nathan Long <h...@nathanmlong.com> wrote:
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()),
...
]
endanddefp 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 elixir-lang-co...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/b9df1290-677c-48f9-8c3c-54192db82156%40googlegroups.com.