Top AI Repos โ open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
๐ Because TDD is awesome
| Date | Stars |
|---|---|
| 2026-07-24 | 955 |
| 2026-07-25 | 955 |
| 2026-07-28 | 955 |
| 2026-07-30 | 955 |
| 2026-08-06 | 955 |
Today
โ stars today
This week
โ stars this week
This month
โ stars this month
Momentum
0.0
growth rate 0.00%/day
# mix test.watch
[](https://travis-ci.org/lpil/mix-test.watch)
[](https://hex.pm/packages/mix_test_watch)
[](https://hexdocs.pm/mix_test_watch/)
[](https://hex.pm/packages/mix_test_watch)
[](https://github.com/lpil/mix-test.watch/blob/master/LICENSE)
[](https://github.com/lpil/mix-test.watch/commits/master)
Automatically run your Elixir project's tests each time you save a file.
Because [Test-driven development (TDD)](https://en.wikipedia.org/wiki/Test-driven_development)
is awesome.
## Usage
Add it to your dependencies:
```elixir
# mix.exs
def deps do
[
{:mix_test_watch, "~> 1.0", only: [:dev, :test], runtime: false}
]
end
```
Optionally, add `preferred_envs: ["test.watch": :test]` for running `mix test.watch` in `:test` env by default.
It prevents the task from running `:dev` env config scripts.
```elixir
# mix.exs
def cli do
[
preferred_envs: [
"test.watch": :test
]
]
end
```
Run the mix task:
```
mix test.watch
```
Start hacking :)
## Running Additional Mix Tasks
Through the mix config it is possible to run other mix tasks as well as the
test task. For example, if I wished to run the [Credo][credo] code analysis
tool after my tests I would do so like this.
[credo]: https://github.com/rrrene/credo
```elixir
# config/config.exs
import Config
if config_env() == :dev do
config :mix_test_watch,
tasks: [
"test",
"credo",
]
end
```
Tasks are run in the order they appear in the list, and the progression will
stop if any command returns a non-zero exit code.
All tasks are run with `MIX_ENV` set to `test`.
## Passing Arguments To Tasks
Any command line arguments passed to the `test.watch` task will be passed
through to the tasks being run. If I only want to run the tests from one file
every time I save a file I could do so with this command:
```
mix test.watch test/file/to_test.exs
```
Note that if you have configured more than one task to be run these arguments
will be passed to all the tasks run, not just the test command.
## Running tests of modules that changed
Elixir's `mix test` provides a `--stale` option that will run only those test files which reference modules that have changed since the last run. You can pass it to test.watch:
```
mix test.watch --stale
```
## Clearing The Console Before Each Run
If you want mix test.watch to clear the console before each run, you can
enable this option in your `config/dev.exs` as follows:
```elixir
# config/config.exs
import Config
if config_env() == :dev do
config :mix_test_watch,
clear: true
end
```
## Excluding files or directories
To ignore changes from specific files or directories just add `exclude:` regexp
patterns to your config in `config/config.exs`:
```elixir
# config/config.exs
import Config
if config_env() == :dev do
config :mix_test_watch,
exclude: [~r/db_migration\/.*/,
~r/useless_.*\.exs/]
end
```
The default is `exclude: [~r/\.#/, ~r{priv/repo/migrations}]`.
## Watching files with other extensions
To watch files with extensions other than the default (`.erl`, `.ex`, `.exs`, `.eex`, `.leex`, `.heex`, `.xrl`, `.yrl`, `.hrl`) add them to `extra_extensions:` in your config:
```elixir
# config/config.exs
import Config
if config_env() == :dev do
config :mix_test_watch,
extra_extensions: [".rs"]
end
```
## Compatibility Notes
On Linux you may need to install `inotify-tools`.
## Desktop Notifications
You can enable desktop notifications with
[ex_unit_notifier](https://github.com/navinpeiris/ex_unit_notifier).
## Alternatives
[mix_test_interactExcerpt of 5,271 characters
Read on GitHub128
6
5
4
Alexander Myasoedov ยท Ukraine
4
3
Christian Wesselhoeft ยท United States
2
2
2
2
Ang ยท Malaysia
2
2
2
2
2
John Hamelink ยท United Kingdom
2
1
1
1
1
Would you bet a product on this? Bounded 0โ100 and slow moving.
matched fp:ff0e8771b8e829eb, topic:testing