Skip to content

Commit

Permalink
Merge pull request #52 from bibipkins/fix/no-reported-tests-if-no-cov…
Browse files Browse the repository at this point in the history
…erage

Fix issue #51 - No tests reported when no coverage found
  • Loading branch information
bibipkins authored Feb 19, 2024
2 parents 1b3c081 + 0a570ce commit 0ea9b32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const parsers = {
const processTestCoverage = (coveragePath, coverageType, coverageThreshold) => __awaiter(void 0, void 0, void 0, function* () {
const filePaths = yield (0, glob_1.glob)(coveragePath, { nodir: true });
if (!filePaths.length) {
throw Error(`No coverage results found by ${coveragePath}`);
(0, utils_1.log)(`No coverage results found by ${coveragePath}`);
return null;
}
const filePath = filePaths[0];
const coverage = yield parsers[coverageType](filePath, coverageThreshold);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export const processTestCoverage = async (
const filePaths = await glob(coveragePath, { nodir: true });

if (!filePaths.length) {
throw Error(`No coverage results found by ${coveragePath}`);
log(`No coverage results found by ${coveragePath}`);
return null;
}

const filePath = filePaths[0];
Expand Down

0 comments on commit 0ea9b32

Please sign in to comment.