Skip to content

Instantly share code, notes, and snippets.

@c0derabbit c0derabbit/pre-commit.sh

Last active Sep 1, 2019
Embed
What would you like to do?
Pre-commit git hook that runs all unit tests before commit
yarn test
RESULT=$?
if [ $RESULT == 1 ]; then
echo "Commit rejected: some tests failed. Please fix the tests before committing."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.