Coverage and Quality Reports
+Page last updated: February 13, 2024
About These Reports
diff --git a/package.json b/package.json index 9eab3e4b02..de39f188dc 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "lint:html": "npm run htmlhint && npm run vnu-jar", "lint:spelling": "cspell \"**/*.*\"", "link-checker": "node ./scripts/link-checker.js", + "coverage-report": "node scripts/coverage-report.js", "reference-tables": "node scripts/reference-tables.js", "regression": "ava --timeout=1m", "regression-report": "node test/util/report", @@ -69,7 +70,9 @@ ], "content/patterns/**/examples/*.html": [ "npm run reference-tables", - "git add content/index/index.html" + "git add content/index/index.html", + "npm run coverage-report", + "git add coverage/" ] }, "ava": { diff --git a/scripts/coverage-report.js b/scripts/coverage-report.js index 2244b571da..c11b240c53 100644 --- a/scripts/coverage-report.js +++ b/scripts/coverage-report.js @@ -1138,12 +1138,26 @@ $('#example_summary_prototype').html(countPrototype); $('#example_summary_mouse').html(countMouse); $('#example_summary_pointer').html(countPointer); +// Create a new Date object +var currentDate = new Date(); + +// Format the date as a string +const formattedDate = currentDate.toLocaleDateString('en-US', { + day: 'numeric', + month: 'long', + year: 'numeric', +}); + // cheerio seems to fold the doctype lines despite the template const result = $.html() .replace('', '\n') .replace( '', '\n' + ) + .replace( + '
Page last updated:
', + `Page last updated: ${formattedDate}
` ); fs.writeFile(coverageReportPath, result, function (err) { diff --git a/scripts/coverage-report.template b/scripts/coverage-report.template index d575bdc47c..c4529e6edf 100644 --- a/scripts/coverage-report.template +++ b/scripts/coverage-report.template @@ -18,6 +18,7 @@Coverage and Quality Reports
+Page last updated:
About These Reports