From 5d309ff52cd399a6b71968a6b9a70c8ac0b98981 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sat, 5 Mar 2022 19:02:27 +0200 Subject: Added node_modules for the updating to work properly. --- .../lib/html-spa/src/summaryHeader.js | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/summaryHeader.js (limited to 'node_modules/istanbul-reports/lib/html-spa/src/summaryHeader.js') diff --git a/node_modules/istanbul-reports/lib/html-spa/src/summaryHeader.js b/node_modules/istanbul-reports/lib/html-spa/src/summaryHeader.js new file mode 100644 index 0000000..3bdd8ff --- /dev/null +++ b/node_modules/istanbul-reports/lib/html-spa/src/summaryHeader.js @@ -0,0 +1,63 @@ +const React = require('react'); + +function Ignores({ metrics, metricsToShow }) { + const metricKeys = Object.keys(metricsToShow); + const result = []; + + for (let i = 0; i < metricKeys.length; i++) { + const metricKey = metricKeys[i]; + if (metricsToShow[metricKey]) { + const skipped = metrics[metricKey].skipped; + if (skipped > 0) { + result.push( + `${skipped} ${metricKey}${ + skipped === 1 ? '' : metricKey === 'branch' ? 'es' : 's' + }` + ); + } + } + } + + if (result.length === 0) { + return false; + } + + return ( +
+ {result.join(', ')} + Ignored +
+ ); +} + +function StatusMetric({ data, name }) { + return ( +
+ {data.pct}%{' '} + {name}{' '} + + {data.covered}/{data.total} + +
+ ); +} + +module.exports = function SummaryHeader({ metrics, metricsToShow }) { + return ( +
+ {metricsToShow.statements && ( + + )} + {metricsToShow.branches && ( + + )} + {metricsToShow.functions && ( + + )} + {metricsToShow.lines && ( + + )} + +
+ ); +}; -- cgit v1.2.3