Created
April 18, 2022 20:03
-
-
Save mikepaszkiewicz/d58a7c01a4fb8594d40ee29347fdc07c to your computer and use it in GitHub Desktop.
Scan mocha directory for it.only, fail pre-commit hook
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 | |
# Scans /tests directory for instances of 'it.only', | |
# If found, cancel commit and log files that need to be fixed. | |
TEST_ERRORS=$(grep -s it.only ../tests/*/** | wc -l) | |
echo "Verifying all tests are enabled..."; | |
if [ $TEST_ERRORS -gt 0 ] | |
then | |
echo "Remove it.only from tests" | |
grep -s it.only ../tests/*/** | |
exit 1 | |
else | |
echo "All tests are enabled!" | |
cd ..; | |
exit 0; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment