phantomjs/bridge.js
function createGruntListener(ev, runner) {
    runner.on(ev, function(test, err) {
      var data = {
        err: err
      };

      if (test) {
        data.title = test.title;
        data.fullTitle = test.fullTitle();
        data.state = test.state;
        data.duration = test.duration;
        data.slow = test.slow;
        data.pending = test.isPending();
      }

      sendMessage('mocha.' + ev, data);
    });
  }
function createGruntListener(ev, runner) {
    runner.on(ev, function(test, err) {
      var data = {
        err: err
      };

      if (test) {
        data.title = test.title;
        data.fullTitle = test.fullTitle();
        data.state = test.state;
        data.duration = test.duration;
        data.slow = test.slow;
        data.pending = test.isPending();
      }

      sendMessage('mocha.' + ev, data);
    });
  }
function createGruntListener ( ev , runner ) { runner . on ( ev , function ( test , err ) { var data = { err : err } ; if ( test ) { data . title = test . title ; data . fullTitle = test . fullTitle ( ) ; data . state = test . state ; data . duration = test . duration ; data . slow = test . slow ; data . pending = test . isPending ( ) ; } sendMessage ( 'mocha.' + ev , data ) ; } ) ; }
Create a listener who'll bubble events from PhantomJS to Grunt
Create a listener who ll bubble events from PhantomJS to Grunt