tasks/mocha.js
function(err) {
          var stats = runner.stats;
          testStats.push(stats);

          if (err) {
            // Show Growl notice
            // @TODO: Get an example of this
            // growl('PhantomJS Error!');

            // If there was a PhantomJS error, abort the series.
            grunt.fatal(err);
            done(false);
          } else {
            // If failures, show growl notice
            if (stats.failures > 0) {
              var reduced = helpers.reduceStats([stats]);
              var failMsg = reduced.failures + '/' + reduced.tests +
                ' tests failed (' + reduced.duration + 's)';

              // Show Growl notice, if avail
              growl(failMsg, {
                image: asset('growl/error.png'),
                title: 'Failure in ' + grunt.task.current.target,
                priority: 3
              });

              // Bail tests if bail option is true
              if (options.bail) grunt.warn(failMsg);
            }

            // Process next file/url
            next();
          }
        }
function(err) {
          var stats = runner.stats;
          testStats.push(stats);

          if (err) {
            // Show Growl notice
            // @TODO: Get an example of this
            // growl('PhantomJS Error!');

            // If there was a PhantomJS error, abort the series.
            grunt.fatal(err);
            done(false);
          } else {
            // If failures, show growl notice
            if (stats.failures > 0) {
              var reduced = helpers.reduceStats([stats]);
              var failMsg = reduced.failures + '/' + reduced.tests +
                ' tests failed (' + reduced.duration + 's)';

              // Show Growl notice, if avail
              growl(failMsg, {
                image: asset('growl/error.png'),
                title: 'Failure in ' + grunt.task.current.target,
                priority: 3
              });

              // Bail tests if bail option is true
              if (options.bail) grunt.warn(failMsg);
            }

            // Process next file/url
            next();
          }
        }
function ( err ) { var stats = runner . stats ; testStats . push ( stats ) ; if ( err ) { // Show Growl notice // @TODO: Get an example of this // growl('PhantomJS Error!'); // If there was a PhantomJS error, abort the series. grunt . fatal ( err ) ; done ( false ) ; } else { // If failures, show growl notice if ( stats . failures > 0 ) { var reduced = helpers . reduceStats ( [ stats ] ) ; var failMsg = reduced . failures + '/' + reduced . tests + ' tests failed (' + reduced . duration + 's)' ; // Show Growl notice, if avail growl ( failMsg , { image : asset ( 'growl/error.png' ) , title : 'Failure in ' + grunt . task . current . target , priority : 3 } ) ; // Bail tests if bail option is true if ( options . bail ) grunt . warn ( failMsg ) ; } // Process next file/url next ( ) ; } }
Do stuff when done.
Do stuff when done .