@@ -207,7 +207,11 @@ func TestAddProjectSummary(t *testing.T) {
207
207
assert .Equal (t , testTable .expectedPass , results .Projects [0 ].Summary .Pass )
208
208
assert .Equal (t , testTable .expectedWarningCount , results .Projects [0 ].Summary .WarningCount )
209
209
assert .Equal (t , testTable .expectedErrorCount , results .Projects [0 ].Summary .ErrorCount )
210
- assert .Equal (t , fmt .Sprintf ("Finished linting project. Results:\n Warning count: %v\n Error count: %v\n Rules passed: %v" , testTable .expectedWarningCount , testTable .expectedErrorCount , testTable .expectedPass ), results .ProjectSummaryText (lintedProject ))
210
+ if testTable .expectedErrorCount == 0 && testTable .expectedWarningCount == 0 {
211
+ assert .Equal (t , "Linter results for project: no errors or warnings" , results .ProjectSummaryText (lintedProject ))
212
+ } else {
213
+ assert .Equal (t , fmt .Sprintf ("Linter results for project: %v ERRORS, %v WARNINGS" , testTable .expectedErrorCount , testTable .expectedWarningCount ), results .ProjectSummaryText (lintedProject ))
214
+ }
211
215
}
212
216
}
213
217
@@ -290,7 +294,11 @@ func TestAddSummary(t *testing.T) {
290
294
assert .Equal (t , testTable .expectedPass , results .Passed ())
291
295
assert .Equal (t , testTable .expectedWarningCount , results .Summary .WarningCount )
292
296
assert .Equal (t , testTable .expectedErrorCount , results .Summary .ErrorCount )
293
- assert .Equal (t , fmt .Sprintf ("Finished linting projects. Results:\n Warning count: %v\n Error count: %v\n Rules passed: %v" , testTable .expectedWarningCount , testTable .expectedErrorCount , testTable .expectedPass ), results .SummaryText ())
297
+ if testTable .expectedErrorCount == 0 && testTable .expectedWarningCount == 0 {
298
+ assert .Equal (t , "Linter results for projects: no errors or warnings" , results .SummaryText ())
299
+ } else {
300
+ assert .Equal (t , fmt .Sprintf ("Linter results for projects: %v ERRORS, %v WARNINGS" , testTable .expectedErrorCount , testTable .expectedWarningCount ), results .SummaryText ())
301
+ }
294
302
}
295
303
}
296
304
0 commit comments