From 8ff48453a8b12d9cacf56b0c0c544c8256af64c7 Mon Sep 17 00:00:00 2001 From: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:00:24 -0700 Subject: [PATCH] feat: highlight browser failures (#5222) * Format html.js * Remove newlines between JSDoc comments and their symbols * (temp) update template.html to run tests * Color the stat result icon and text based on root suite result * (temp) add template fail and template pass * On first test fail, add fail indicator to stats * Remove extra newline * Format mocha.css with Prettier * Make pass icon color accessible * Cleanup mocha.css var names * Restore template to main * Remove thirteen-year-old comment https://github.com/mochajs/mocha/commit/440e38cec946826db9e2089c21f570ad3abae852 * Revert "Format html.js" This reverts commit 8552a91de1508d59b44e2b80cf7809030ac8bef5. * Revert "Restore template to main" This reverts commit 854ab12182fb738903cb1383a416d06169a21304. * Color passes and failures count as well * Cleanup stats variables to consts * Fix stats not updating on root suite end * Revert "Remove extra newline" This reverts commit 27a79585eee5a60a5dec67a8f27f9c62543921bb. * Restore newlines :( * Restore newlines for real * Reapply "Remove extra newline" This reverts commit c43bffeae50663f69b2b35e8a84bf3af2dfba9b0. * Revert "Format mocha.css with Prettier" This reverts commit 0898ed586c3a39e6ea73a902275c440b8e04461f. * indent to 5, not 6 chars in mocha.css * Re-add newline in mocha.css * Reapply "Restore template to main" This reverts commit 714ee1538b6089b4c00fe5daaf523c5985d87e25. --- lib/reporters/html.js | 51 +++++++++++++++++++++++++++---------- mocha.css | 58 ++++++++++++++++++++++++++++++------------- 2 files changed, 79 insertions(+), 30 deletions(-) diff --git a/lib/reporters/html.js b/lib/reporters/html.js index ae4a4546f8..c970fc05e9 100644 --- a/lib/reporters/html.js +++ b/lib/reporters/html.js @@ -32,11 +32,12 @@ var Date = global.Date; exports = module.exports = HTML; /** - * Stats template. + * Stats template: Result, progress, passes, failures, and duration. */ var statsTemplate = '