diff --git a/packages/v8/src/app.vue b/packages/v8/src/app.vue index 7ac4ebcd..a82fad6d 100644 --- a/packages/v8/src/app.vue +++ b/packages/v8/src/app.vue @@ -53,6 +53,7 @@ const indicators = [{ // do not use reactive for grid data const state = shallowReactive({ title: 'Coverage Report', + indicators, summary: {}, group: true, diff --git a/packages/v8/src/components/report.vue b/packages/v8/src/components/report.vue index 422918e2..2d099c8e 100644 --- a/packages/v8/src/components/report.vue +++ b/packages/v8/src/components/report.vue @@ -165,6 +165,25 @@ const renderReport = async () => { const item = data.item; + const summary = item.summary; + // summary list + data.summaryList = state.indicators.filter((it) => { + // no functions for css + if (item.type !== 'js' && it.id === 'functions') { + return false; + } + return true; + }).map((it) => { + const { id, name } = it; + return { + id, + name, + ... summary[id] + }; + }); + + // console.log(data.summaryList); + const report = await getReport(item); if (!report) { console.log(`failed to format source: ${item.sourcePath}`); @@ -231,37 +250,78 @@ onMounted(() => { direction="row" padding="5px" class="mcr-report-head" + wrap + gap="10px" > - - Pretty Print - -
Top Executions
+ {{ item.name }} +
+ {{ Util.PF(item.pct, 100) }} +
-
- L{{ item.line }} +
+ {{ Util.NF(item.covered) }}
-
- x{{ item.count }} +
+ {{ Util.NF(item.uncovered) }}
+
{{ Util.NF(item.total) }}
+ +
Blank
+
{{ item.blank }}
+
Comment
+
{{ item.comment }}
+
+ + + Format + + + + +
Top Executions
+ +
+ L{{ item.line }} +
+
+ x{{ item.count }} +
+
{ } } -@media (hover: none) { - .mcr-report-item { - flex-wrap: nowrap; - overflow-x: auto; +.mcr-report-percent { + padding: 0 3px; + border-radius: 3px; +} + +.mcr-report-values { + padding: 0 3px; + border: 1px solid #ccc; + border-radius: 3px; + + .mcr-covered, + .mcr-uncovered { + padding-right: 5px; + border-right: 1px solid #ccc; } }