Created
December 13, 2017 19:53
-
-
Save benhorst/8162949afb39d71fc55fa4389ee9daa9 to your computer and use it in GitHub Desktop.
We use Mocha for 'describe' and 'it' blocks. Sometimes we use 'describe.only' locally, but we want to be sure not to push it! (also a good 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/sh | |
# README: remember to chmod +x this file, save the contents to `my-project/.git/hooks/pre-push` | |
echo "HOOK PRE-PUSH: Checking for describe.only in test files..." | |
count=$(grep describe.only src/**/*.test.js | wc -l) | |
if [ "$count" -eq 0 ] | |
then | |
echo "No describe.only blocks found.\n" | |
exit 0 | |
fi | |
echo "Found $count describe.only blocks\n" | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment