Fail tests when there are JavaScript errors on the page

In the current version of jasmine-phantom, it is possible to have a green build in spite of there being JavaScript errors on the page. This is something I don't like in my test runs (reduces confidence that I'm deploying something that works), so I wrote a patch which I'm hoping will be useful to others.

This patch causes the build to fail when there are such errors, and logs useful information surrounding each of the errors, like this:

    Build failed due to the following JavaScript errors:
    TypeError: 'undefined' is not an object (evaluating 'undefined.someMethodCall')
     -> http://localhost:51809/public/javascripts/throws_error.js: 2
     -> http://localhost:51809/public/javascripts/throws_error.js: 5

A minimal test case for these changes can be found at https://github.com/Sinjo/js-error-example

The method used requires PhantomJS >= 1.5.0