Skip to content

Commit

Permalink
fixed warn message for adding empty istanbul coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jun 29, 2024
1 parent a7fccde commit 8fdef04
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,14 @@ const addEmptyData = async (mcr, dataList, sourceCache) => {
return;
}

Util.logDebug(`added "all" files with empty coverage: ${EC.yellow(emptyData.length)}`);
let files = 0;
if (Util.isList(emptyData)) {
files = emptyData.length;
} else {
files = Object.keys(emptyData).length;
}

Util.logDebug(`added all files with empty coverage: ${EC.yellow(files)}`);
const coverageResults = await mcr.add(emptyData);
// after `add`
if (!coverageResults) {
Expand Down

0 comments on commit 8fdef04

Please sign in to comment.