I tried following the article “Testing with Ecto”:
However I have a series of warnings and errors; first is:
warning: could not find Ecto repos in any of the apps: [:my_app].
However, I have a config/test.exs file with the following content:
use Mix.Config
config :my_app, MyApp.Repo,
username: "postgres",
password: "postgres",
database: "my_app_test",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox
I created the MyApp.RepoCase and use it in the test file (use MyApp.RepoCase) as mentioned in the article, and appended this line to test_helper.exs:
Ecto.Adapters.SQL.Sandbox.mode(MyApp.Repo, :manual)
What is missing?
It ends in a runtime error:
** (RuntimeError) could not lookup Ecto repo MyApp.Repo because it was not started or it does not exist
Note that this is a library, so I do not want to make an application that will start when a user depend on the library.






















