I have a gulp task test which uses mocha to run my unit tests.
I want to run the unit tests as part of a GIT pre-commit hook.
So basically my pre-commit file looks like this:
#!/bin/bash
gulp test
The problem I have is that even if a test fails, the commit is made. How can I detect a test failure from my pre-commit file?