refactor: simplify test asserts (#1271)

This commit is contained in:
Oleksandr Redko authored and GitHub committed 2023-10-03 10:38:08 -05:00
1 parent d37b38f2ee
commit 2959fc072c
10 files changed
+151 -297

No files matched your search

+3 -2
View File
@@ -5,6 +5,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/zricethezav/gitleaks/v8/report"
)
@@ -82,7 +83,7 @@ func TestFileLoadBaseline(t *testing.T) {
for _, test := range tests {
_, err := LoadBaseline(test.Filename)
assert.Equal(t, test.ExpectedError.Error(), err.Error())
assert.Equal(t, test.ExpectedError, err)
}
}
@@ -132,6 +133,6 @@ func TestIgnoreIssuesInBaseline(t *testing.T) {
for _, finding := range test.findings {
d.addFinding(finding)
}
assert.Equal(t, test.expectCount, len(d.findings))
assert.Len(t, d.findings, test.expectCount)
}
}