Last active
August 29, 2015 14:04
-
-
Save madx/2462ce6972aa79293efc to your computer and use it in GitHub Desktop.
Test runner with tape + tap-dot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TEST_FILES=`find test/ -name "*.js"` | |
run_tests() { | |
local tests="$@" | |
for test in $tests; do | |
echo -ne "\033[1;33m$test\033[0m" | |
tape $test | tap-dot | |
done | |
} | |
run_tests $TEST_FILES | |
inotifywait -qrm lib/ test/ -e CLOSE_WRITE | while read change; do | |
file=$(echo $change | cut -d' ' -f3-) | |
dir=$(echo $change | cut -d' ' -f1) | |
if [ ${dir%%/*} = "lib" ]; then | |
echo "Running all tests " | |
run_tests $TEST_FILES | |
else | |
echo "Running tests for $dir$file" | |
run_tests $dir$file | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment