I use entr to run commands automatically when files change. Here’s how I use it to run tests.
Use:
ls lib/* spec/* | entr -c bin/test
Notes:
- Install:
brew install entr -cclears the screen before running the commandfind lib spec -name '*.rb'works the similarly tols, but I can’t always remember the syntaxgit ls-filesis another option for watching tracked files in a repowatchexecis an alternative toentr, known for being more feature-rich