TheSquad
TheSquad

Reputation: 7506

Elixir ExUnit test with custom dependency environnement

I have a project A, which depends on a dependency B created by me also...

when I want to launch test on A with a simple mix test, it's getting the dependecy B, compiling it and starting it in :prod environnement...

Which mean A is in :test environnement and B is in :prod env.

I would like for the tests to launch the dependency in :dev environnement (or anything else but :prod), is there a way to do that ?

Upvotes: 1

Views: 191

Answers (1)

PatNowak
PatNowak

Reputation: 5812

Maybe your MIX_ENV is prod and mix test doesn't change it to test. Try explicitly:

MIX_ENV=test mix test

and for dev

MIX_ENV=dev mix test

Upvotes: 1

Related Questions