Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Commit 9ca8943

Browse files
committed
Celebrate when no violations
1 parent 37e9ee6 commit 9ca8943

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

index.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,12 @@ function printStats() {
162162
}, 0)
163163
console.log(` Average Page Audit Time: ${Math.round(totalTime/stats.pageCount)} ms`);
164164
console.log(` Total Audits Passed: ${stats.passedAuditsCount}`, '\u2713'.green);
165-
console.log(` Total Violations:`);
166-
Object.keys(stats.violationCounts).forEach(category => {
167-
console.log(` ${category}: ${stats.violationCounts[category]}`, '\u2717'.red);
168-
})
165+
if (Object.keys(stats.violationCounts).length === 0) {
166+
console.log(` Total Violations: None! \\o/ 🎉`);
167+
} else {
168+
console.log(` Total Violations:`);
169+
Object.keys(stats.violationCounts).forEach(category => {
170+
console.log(` ${category}: ${stats.violationCounts[category]}`, '\u2717'.red);
171+
})
172+
}
169173
}

0 commit comments

Comments
 (0)