Skip to content

Commit 7a9d77f

Browse files
authored
feat: highlight 100% line coverage (#11)
1 parent 3c59207 commit 7a9d77f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coverage/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
td.num { text-align:right; }
2525
.missed-line { background:#fee; }
2626
.hit-line { background:#efe; }
27+
tr.full-coverage { background:#dfd; }
28+
tr.full-coverage:hover { background:#cfc; }
2729
pre { overflow:auto; }
2830
.code-line { display:block; margin:0; padding:0.1rem 0; }
2931
.code-line .ln { color:#888; display:inline-block; min-width:3em; }
@@ -259,6 +261,7 @@
259261
const full=parentPath? parentPath+'/'+name : name;
260262
if(child.file){
261263
const tr=document.createElement('tr');
264+
if(child.file.linePct >= 100) tr.classList.add('full-coverage');
262265
tr.dataset.parent=parentPath;
263266
tr.innerHTML=`<td class="file" style="padding-left:${depth*1.25}rem">${escapeHtml(name)}</td>`+
264267
`<td class="num">${child.file.linePct.toFixed(1)}%</td><td class="num">${child.file.totals.LH}/${child.file.totals.LF}</td>`+
@@ -273,6 +276,7 @@
273276
const branchPct=pct(child.totals.BRH,child.totals.BRF);
274277
const tr=document.createElement('tr');
275278
tr.className='folder';
279+
if(linePct >= 100) tr.classList.add('full-coverage');
276280
tr.dataset.path=full;
277281
tr.dataset.parent=parentPath;
278282
tr.innerHTML=`<td class="file" style="padding-left:${depth*1.25}rem">${escapeHtml(name)}</td>`+

0 commit comments

Comments
 (0)