Get console result of unit/e2e tests


I’m using phantomjs to get the result of my tests in the console:

meteor test --once --driver-package dispatch:mocha-phantomjs --port 3100

Now I would like to create a git pre-push hook, but how do I get the result of the test into a script?

So if I want to do a push on my local git repository the test should be run. If the test is passing, a push will be done. If there is a failed test, nothing will happen. How can I do that?