From 9bdb95c9e34cef640534e5e5a1e2225a80442000 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期四, 09 六月 2022 15:48:15 +0800
Subject: [PATCH] TODO#139894 [ footer -最下方說明與保經代合作 ] 文案修改

---
 PAMapp/node_modules/istanbul-reports/lib/html/annotator.js |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/PAMapp/node_modules/istanbul-reports/lib/html/annotator.js b/PAMapp/node_modules/istanbul-reports/lib/html/annotator.js
index be8a453..84d8fc3 100644
--- a/PAMapp/node_modules/istanbul-reports/lib/html/annotator.js
+++ b/PAMapp/node_modules/istanbul-reports/lib/html/annotator.js
@@ -164,6 +164,22 @@
                     gt;
                 closeSpan = lt + '/span' + gt;
 
+                // If the branch is an implicit else from an if statement,
+                // then the coverage report won't show a statistic.
+                // Therefore, the previous branch will be used to report that
+                // there is no coverage on that implicit branch.
+                if (
+                    count === 0 &&
+                    startLine === undefined &&
+                    branchMeta[branchName].type === 'if'
+                ) {
+                    const prevMeta = metaArray[i - 1];
+                    startCol = prevMeta.start.column;
+                    endCol = prevMeta.end.column + 1;
+                    startLine = prevMeta.start.line;
+                    endLine = prevMeta.end.line;
+                }
+
                 if (count === 0 && structuredText[startLine]) {
                     //skip branches taken
                     if (endLine !== startLine) {

--
Gitblit v1.8.0