Skip to content

Commit 572139c

Browse files
committed
feat: 升级到 v2.6.0 修复两个 bug
1 parent c8d14bc commit 572139c

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "incremental-coverage",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"description": "Merge lcov.info and get incremental coverage and full coverage",
55
"main": "lib/index.js",
66
"bin": {

src/concat/increaseConcat.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ export class IncreaseConcat implements Concat {
9090
delete this.res.detail[lcovItem];
9191

9292
this.diffData.forEach((diffItem) => {
93-
if (lcovItem.toLocaleLowerCase().includes(diffItem.newPath.toLocaleLowerCase())) {
93+
// 注意 diffItem.newPath 有可能不存在,例如被删除的文件就木有
94+
if (lcovItem.toLocaleLowerCase().includes(diffItem.newPath?.toLocaleLowerCase())) {
9495
// 计算本文件的覆盖率
9596
const temp: DetailLines = {
9697
lineRate: 0,

src/parsers/log.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ export class LogParser implements Parser {
3030
throw new Error('请选择 git 仓库运行');
3131
}
3232

33-
// 执行 log
34-
const log = await gitlogPromise({ ...this.opt, number: 10000 });
33+
// 执行 log,限制条数,否则会由于输出太多内容导致 ERR_CHILD_PROCESS_STDIO_MAXBUFFER 问题
34+
// https://www.npmjs.com/package/gitlog
35+
const log = await gitlogPromise({ ...this.opt, number: 10 });
3536

3637
return log;
3738
}

0 commit comments

Comments
 (0)