Skip to content

Commit 39473dc

Browse files
authored
go-junit-report_test should fail if no files found
Today, if the testdata directory isn't present, this test trivially passes. This makes it fail when no files are found.
1 parent d6bf223 commit 39473dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/gojunitreport/go-junit-report_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ func TestRun(t *testing.T) {
3333
if err != nil {
3434
t.Fatalf("error finding files in testdata: %v", err)
3535
}
36+
if len(files) == 0 {
37+
t.Fatalf("no files found in %s", testDataDir)
38+
}
3639

3740
for _, file := range files {
3841
if !matchRegex.MatchString(file) {

0 commit comments

Comments
 (0)