From aa5edfcc6d14a85ac7f3cea1e0b3f51aff71c2a9 Mon Sep 17 00:00:00 2001 From: zhangtao25 Date: Mon, 30 Dec 2024 19:54:08 +0800 Subject: [PATCH] chore: daily development --- packages/canyon-collect/src/utils/coverage.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/canyon-collect/src/utils/coverage.ts b/packages/canyon-collect/src/utils/coverage.ts index a86b4598..e90951e3 100644 --- a/packages/canyon-collect/src/utils/coverage.ts +++ b/packages/canyon-collect/src/utils/coverage.ts @@ -42,10 +42,13 @@ export function formatReportObject(c: any) { }; const obj: any = {}; for (const coverageKey in coverage) { - obj[reversePath(coverageKey)] = { - ...coverage[coverageKey], - path: reversePath(coverageKey), - }; + // 这里是特殊逻辑,只有他们不想等的时候才是成功替换过的 + if (reversePath(coverageKey) !== coverageKey) { + obj[reversePath(coverageKey)] = { + ...coverage[coverageKey], + path: reversePath(coverageKey), + }; + } } // 确保修改成istanbul格式,去掉start、end为空的情况