title: Pre-Commit Hook Unit Test
body: <p>I am trying to run a pre-commit hook that prevents me from committing if my unit tests don't run. Right now I have a shell script that  runs the tests and my terminal tells me that they have failed, which is good. But I am not sure what to put in my Shell Script to actually stop my commit once my terminal detects that I have failing tests. 
  Like this:
  <a href="https://i.stack.imgur.com/SxtS5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SxtS5.png" alt="enter image description here"></a></p>
  
  <p>I am inclined to think that all I am missing is a simple if statement which checks if the tests fail then stop the commit and if the tests pass then complete the commit. But I could be completely wrong about that, and this is my first time working with shell scripts so I am not really sure how to go about doing that. Thanks.</p>