Skip to content

Instantly share code, notes, and snippets.

@eszterkv
Last active September 1, 2019 15:27
Show Gist options
  • Save eszterkv/618c000d4adc4d6fb6a242e434c2f9cd to your computer and use it in GitHub Desktop.
Save eszterkv/618c000d4adc4d6fb6a242e434c2f9cd to your computer and use it in GitHub Desktop.
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