Background
So I am using this library mix-test.watch from @lpil which I really like.
Usually I just run mix test.watch
and I let the process running.
As a bonus to this library, you can also execute it by passing the --only
flag. For example, if I want to watch only my “super_duper_tests” I can do it like this: mix text.watch --only super_duper_tests
and this will only watch all the tests that have, for example, the @moduletag :super_duper_tests
on them.
Enter Alias
So, this is all fun, but I am lazy and I don’t like typing. So I want to create an alias like this:
mix test.watch.super_duper
that will be translated to mix text.watch --only super_duper_tests
.
To achieve this I tried the following on my mix.exs
file:
defp aliases do
[
"test.watch.super_duper": ["test.watch --only super_duper_tests"]
]
end
Problem
You may have guessed, since I am posting here, that this is not working. When I try my new alias, I get the error message Could not find test.watch task
.
So obviously I am doing something wrong in the configuration.
Questions
How can I create an alias for mix test.watch
?