Skip to content

Commit

Permalink
Merge pull request #258 from nlfurniss/patch-1
Browse files Browse the repository at this point in the history
Don't print to the console when there are no issues
  • Loading branch information
Andrew A Lee authored Apr 28, 2021
2 parents 803bd03 + 2aaf056 commit 009b08a
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions addon-test-support/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,41 +159,43 @@ export function storeResults(results: AxeResults) {
* @public
*/
export function printResults() {
console.group('%cAxe issues', serious);
testSuiteResults.forEach((results) => {
results.forEach((result) => {
let fmt: string;
switch (result.impact) {
case 'critical':
fmt = critical;
break;
case 'serious':
fmt = serious;
break;
case 'moderate':
fmt = moderate;
break;
case 'minor':
fmt = minor;
break;
default:
fmt = minor;
break;
}
console.groupCollapsed(
'%c%s: %c%s %s',
fmt,
result.impact,
defaultReset,
result.help,
result.helpUrl
);
result.nodes.forEach((node) => {
failureSummary(node, 'any');
failureSummary(node, 'none');
if (testSuiteResults.length) {
console.group('%cAxe issues', serious);
testSuiteResults.forEach((results) => {
results.forEach((result) => {
let fmt: string;
switch (result.impact) {
case 'critical':
fmt = critical;
break;
case 'serious':
fmt = serious;
break;
case 'moderate':
fmt = moderate;
break;
case 'minor':
fmt = minor;
break;
default:
fmt = minor;
break;
}
console.groupCollapsed(
'%c%s: %c%s %s',
fmt,
result.impact,
defaultReset,
result.help,
result.helpUrl
);
result.nodes.forEach((node) => {
failureSummary(node, 'any');
failureSummary(node, 'none');
});
console.groupEnd();
});
console.groupEnd();
});
});
console.groupEnd();
console.groupEnd();
}
}

0 comments on commit 009b08a

Please sign in to comment.