Skip to content

Instantly share code, notes, and snippets.

@aequanimitas
Forked from josevalim/watcher.sh
Last active June 24, 2022 16:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aequanimitas/37a175e37249ce67dfbe15ee195763eb to your computer and use it in GitHub Desktop.
Save aequanimitas/37a175e37249ce67dfbe15ee195763eb to your computer and use it in GitHub Desktop.
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
# fswatch lib/ test/ | mix test --stale --listen-on-stdin
fswatch -0 --latency=0.01 --one-per-batch lib test | mix test --stale test/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment