Skip to content

Commit f28e251

Browse files
committed
Fix error message for no tests
1 parent f0ae8b3 commit f28e251

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

dist/index.js

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

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

index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,16 @@ async function run() {
7777
core.setFailed(`Missing tests for ${untestedLines.length} files.`)
7878

7979
for (let i = 0; i < untestedLines.length; i++) {
80-
const { path, all } = untestedLines[i]
81-
core.error(
82-
`Coverage: ${path} is missing tests for lines ${JSON.stringify(all)}`
83-
)
80+
const { path, all, hasTests } = untestedLines[i]
81+
if (hasTests) {
82+
core.error(
83+
`Coverage: ${path} is missing tests for lines ${JSON.stringify(
84+
all
85+
)}`
86+
)
87+
} else {
88+
core.error(`Coverage: ${path} is not being tested`)
89+
}
8490
}
8591
}
8692
} catch (error) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "diff-coverage",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Checks that the added and modified lines are covered by unit tests",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)