# Warning function is undefined

**URL:** <https://forum.elixirforum.com/t/warning-function-is-undefined/4046>\
**Category:** Questions\
**Tags:** troubleshooting\
**Created:** [March 8, 2017, 2:16pm UTC](https://forum.elixirforum.com/t/warning-function-is-undefined/4046 "2017-03-08T14:16:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngw](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ngw/32/1937_2.png) [@ngw](https://forum.elixirforum.com/u/ngw)\
**Post date:** [March 8, 2017, 2:16pm UTC](https://forum.elixirforum.com/t/warning-function-is-undefined/4046/1 "2017-03-08T14:16:54Z")

</div>

Hello, I have a strange warning when running my tests:

```
warning: function Parker.Test.FakeHTTPipe.get/2 is undefined (module Parker.Test.FakeHTTPipe is not available)
lib/parker/adapters/httpipe.ex:6

```

I’ve build a “fake” http library that should be used in my tests in substitution to HTTPipe.  
This library is located under test/support and is loaded just before running the tests in test\_helper.exs

```
Path.join([File.cwd!, "test", "support", "*"])
|> Path.wildcard
|> Enum.map(fn(file) -> Code.load_file(file) end)

```

and called by the app using config/test.exs and a variable that points to the configuration (pretty much the same as in [Mocks and explicit contracts « Plataformatec Blog](http://blog.plataformatec.com.br/2015/10/mocks-and-explicit-contracts/))  
Am I supposed to Code.load\_file somewhere else to make that warning disappear?

Thanks in advance, ngw

---

<div class="post-metadata">

**Author:** ![hubertlepicki](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/32/6822_2.png) [@hubertlepicki](https://forum.elixirforum.com/u/hubertlepicki)\
**Post date:** [March 8, 2017, 2:28pm UTC](https://forum.elixirforum.com/t/warning-function-is-undefined/4046/2 "2017-03-08T14:28:06Z")

</div>

In comments, in article you liked to is a solution. I do not think you need to use Code.load at all. Instead you can add the test/support to the compile path in test Mix.env and it should compile it / include properly.

Check out his example mixfile from Phoenix itself (also linked in the comments):  
[https://github.com/phoenixframework/phoenix/blob/master/installer/templates/new/mix.exs#L30-L31](https://github.com/phoenixframework/phoenix/blob/master/installer/templates/new/mix.exs#L30-L31)

---

<div class="post-metadata">

**Author:** ![ngw](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ngw/32/1937_2.png) [@ngw](https://forum.elixirforum.com/u/ngw)\
**Post date:** [March 8, 2017, 2:48pm UTC](https://forum.elixirforum.com/t/warning-function-is-undefined/4046/3 "2017-03-08T14:48:27Z")

</div>

Ahhh, and what’s funny is that I already had that, but of course it wasn’t working because in test/support I was writing .exs files…  
Thanks a lot!
