What is the idiomatic way of including a file in a mix project?

Hello everyone, Elixir newbie here.

I wanted to include a file containing a mocked module. I found 3 ways of doing this:

  1. Code.load_file

  2. Adding the directory containing the file to the elixirc_paths list in the mix.exs

  3. Code.require_file
    Is one way better than the other or is there another more idiomatic way?

1 Like

I usually add the test/support directory to the elixirc_paths and put my mocks, helper code there