gruntjs/grunt-lib-phantomjs — pull request #24 by jaredstehler (2013-05-03 20:07:29+00:00)
Title: Handle multiple onLoadFinished callbacks with no-op

My jasmine test suite make heavy use of iframes, and I've seen that the onLoadFinished callback gets invoked multiple times during the course of the suite run, once for the main page and again for iframes. Sometimes one of these frames fails (possibly due to a dummy or null src?) and it causes the phantom proc to exit in this function. With this code in place my suite runs to completion successfully.

I found a similar fix committed in guard-jasmine a while back: https://github.com/netzpirat/guard-jasmine/pull/19