karma-runner/grunt-karma — pull request #59 by trabianmatt (2013-09-16 13:21:10+00:00)
Title: Kill background child process on main process exit

The instructions for using grunt-karma with `background:true` indicate the need to have a `watch` task that runs, for example, the `karma:unit:run` task when a watched file changes (via `$ grunt karma:unit watch`).

This makes sense, but we were finding that if `karma:unit` was run without calling the `watch` task afterwards then Grunt was exiting immediately with a success code and the background process created by grunt-karma wasn't exiting.

Obviously we could avoid this problem by making sure that the `karma:unit` task was never run independently, but mistakes happen. The changes in this pull request will kill the background process on the processes 'exit' event.