1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor older tests to use testify (#33140)

Refactor checks to use assert/require
Use require.Eventually for waiting in elastic and meilisearch tests
Use require to exit early instead of assert
This commit is contained in:
TheFox0x7
2025-01-09 02:21:47 +01:00
committed by GitHub
parent fa9191b7b9
commit 2a02734f93
42 changed files with 218 additions and 348 deletions

View File

@@ -3,7 +3,11 @@
package analyze
import "testing"
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsVendor(t *testing.T) {
tests := []struct {
@@ -33,9 +37,8 @@ func TestIsVendor(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.path, func(t *testing.T) {
if got := IsVendor(tt.path); got != tt.want {
t.Errorf("IsVendor() = %v, want %v", got, tt.want)
}
got := IsVendor(tt.path)
assert.Equal(t, tt.want, got)
})
}
}