Skip to content

Commit

Permalink
fix(reporter.js): change how to show the results
Browse files Browse the repository at this point in the history
  • Loading branch information
felixzapata committed Aug 9, 2016
1 parent 1ae844e commit afab3f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ module.exports = function(results, threshold) {
var violations = result.violations;
if (violations.length) {
if (threshold < 0) {
chalk.green('Found ' + violations.length + ' accessibility violations: (no threshold)');
console.log(chalk.green('Found ' + violations.length + ' accessibility violations: (no threshold)'));
} else if (violations.length > threshold) {
pass = false;
chalk.error('Found ' + violations.length + ' accessibility violations:');
console.log(chalk.red('Found ' + violations.length + ' accessibility violations:'));
} else {
chalk.green('Found ' + violations.length + ' accessibility violations: (under threshold of ' + threshold + ')');
console.log(chalk.green('Found ' + violations.length + ' accessibility violations: (under threshold of ' + threshold + ')'));
}
violations.forEach(function(ruleResult) {
grunt.log.subhead(' ' + color(31, '\u00D7') + ' ' + ruleResult.help);
console.log(' ' + color(31, '\u00D7') + ' ' + ruleResult.help);

ruleResult.nodes.forEach(function(violation, index) {
console.log(' ' + (index + 1) + '. ' + JSON.stringify(violation.target));
Expand All @@ -44,7 +44,7 @@ module.exports = function(results, threshold) {
});
});
} else {
chalk.green('Found no accessibility violations.');
console.log(chalk.green('Found no accessibility violations.'));
}
});

Expand Down

0 comments on commit afab3f9

Please sign in to comment.