tasks/a11y.js
function logReports (url, reports, verbose) {
    var passes = '';
    var failures = '';

    grunt.log.writeln(chalk.underline(chalk.cyan('\nReport for ' + url + '\n')));
    reports.audit.forEach(function (el) {
        if (el.result === 'PASS') {
            passes += logSymbols.success + ' ' + el.heading + '\n';
        }

        if (el.result === 'FAIL') {
            failures += logSymbols.error + ' ' + el.heading + '\n';
            failures += el.elements + '\n\n';
        }
    });

    grunt.log.writeln(indent(failures, ' ', 2));
    grunt.log.writeln(indent(passes  , ' ', 2));

    if (verbose) {
      grunt.log.writeln('VERBOSE OUTPUT\n', reports.audit);
    }

    return !failures.length;
  }
function logReports (url, reports, verbose) {
    var passes = '';
    var failures = '';

    grunt.log.writeln(chalk.underline(chalk.cyan('\nReport for ' + url + '\n')));
    reports.audit.forEach(function (el) {
        if (el.result === 'PASS') {
            passes += logSymbols.success + ' ' + el.heading + '\n';
        }

        if (el.result === 'FAIL') {
            failures += logSymbols.error + ' ' + el.heading + '\n';
            failures += el.elements + '\n\n';
        }
    });

    grunt.log.writeln(indent(failures, ' ', 2));
    grunt.log.writeln(indent(passes  , ' ', 2));

    if (verbose) {
      grunt.log.writeln('VERBOSE OUTPUT\n', reports.audit);
    }

    return !failures.length;
  }
function logReports ( url , reports , verbose ) { var passes = '' ; var failures = '' ; grunt . log . writeln ( chalk . underline ( chalk . cyan ( '\nReport for ' + url + '\n' ) ) ) ; reports . audit . forEach ( function ( el ) { if ( el . result === 'PASS' ) { passes += logSymbols . success + ' ' + el . heading + '\n' ; } if ( el . result === 'FAIL' ) { failures += logSymbols . error + ' ' + el . heading + '\n' ; failures += el . elements + '\n\n' ; } } ) ; grunt . log . writeln ( indent ( failures , ' ' , 2 ) ) ; grunt . log . writeln ( indent ( passes , ' ' , 2 ) ) ; if ( verbose ) { grunt . log . writeln ( 'VERBOSE OUTPUT\n' , reports . audit ) ; } return ! failures . length ; }
Utility function that logs an audit in the console and
returns a boolean with the validity of the audit.

@param  {String}       url
@param  {a11y reports} reports
@return {Boolean}      if the audit is valid
Utility function that logs an audit in the console and returns a boolean with the validity of the audit .