jeudi 23 juin 2016

How can I run unit tests without calling application callback

My application callback start Supervisor that conflicts with unit tests.

With that callback I am getting something like {:error, {:already_started, #PID<0.258.0>}} when I try to run unit test because my processes are already started.

Can I execute Application callback only for :dev and :prod, keeping :test environment clean of startup code?

I am looking for something like this:

def application do
[
  applications: [:logger],
  mod: {MyApplication, [], only: [:test, :prod]} 
]

only: [:test, :prod] - this is missing piece

Aucun commentaire:

Enregistrer un commentaire