#development #elixir #reading-list #testing

🔗 Note: Alias for fast testing in Elixir
petar.dev

In my previous note Shorter feedback loops with Elixir tests I already described how to run tests in Elixir, where it only runs the failed tests. Below is what I put in my mix.exs file to have faster feedback loops when testing:

 1defp aliases do
 2    [
 3        ...
 4        "test.failed": ["test --failed --max-failures 1"],
 5    ]
 6end
 7
 8# Make sure the alias runs in the test MIX_ENV environment.
 9def cli do
10    [preferred_envs: ["test.failed": :test]]
11end

This will create a new alias test.failed that will run only the failed tests and stop after the first failure. This is useful when you are working on a specific test and you want to run it quickly without running all the tests.

continue reading on petar.dev

⚠️ This post links to an external website. ⚠️