From 8552a91de1508d59b44e2b80cf7809030ac8bef5 Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Thu, 10 Oct 2024 05:55:47 -0700 Subject: [PATCH 01/25] Format html.js --- lib/reporters/html.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/reporters/html.js b/lib/reporters/html.js index ae4a4546f8..e38db8dd8b 100644 --- a/lib/reporters/html.js +++ b/lib/reporters/html.js @@ -73,7 +73,8 @@ function HTML(runner, options) { var progressBar = items[0].getElementsByTagName('progress')[0]; var progressRing = [ items[0].getElementsByClassName('ring-flatlight')[0], - items[0].getElementsByClassName('ring-highlight')[0]]; + items[0].getElementsByClassName('ring-highlight')[0] + ]; var progressRingRadius = null; // computed CSS unavailable now, so set later var root = document.getElementById('mocha'); @@ -233,14 +234,20 @@ function HTML(runner, options) { ); } if (progressRing) { - var radius = parseFloat(getComputedStyle(progressRing[0]).getPropertyValue('r')); + var radius = parseFloat( + getComputedStyle(progressRing[0]).getPropertyValue('r') + ); var wholeArc = Math.PI * 2 * radius; var highlightArc = percent * (wholeArc / 100); // The progress ring is in 2 parts, the flatlight color and highlight color. // Rendering both on top of the other, seems to make a 3rd color on the edges. // To create 1 whole ring with 2 colors, both parts are inverse of the other. - progressRing[0].style['stroke-dasharray'] = `0,${highlightArc}px,${wholeArc}px`; - progressRing[1].style['stroke-dasharray'] = `${highlightArc}px,${wholeArc}px`; + progressRing[0].style[ + 'stroke-dasharray' + ] = `0,${highlightArc}px,${wholeArc}px`; + progressRing[1].style[ + 'stroke-dasharray' + ] = `${highlightArc}px,${wholeArc}px`; } // update stats From 341d6144dada8ab387e76847ce783f124b12709b Mon Sep 17 00:00:00 2001 From: Mark Wiemer Date: Thu, 10 Oct 2024 05:57:18 -0700 Subject: [PATCH 02/25] Remove newlines between JSDoc comments and their symbols --- lib/reporters/html.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/reporters/html.js b/lib/reporters/html.js index e38db8dd8b..24a90905b4 100644 --- a/lib/reporters/html.js +++ b/lib/reporters/html.js @@ -7,7 +7,6 @@ /** * Module dependencies. */ - var Base = require('./base'); var utils = require('../utils'); var escapeRe = require('escape-string-regexp'); @@ -22,19 +21,16 @@ var escape = utils.escape; /** * Save timer references to avoid Sinon interfering (see GH-237). */ - var Date = global.Date; /** * Expose `HTML`. */ - exports = module.exports = HTML; /** * Stats template. */ - var statsTemplate = '