From 2a02734f93c0091275c77e370b7eed03b2c5f18e Mon Sep 17 00:00:00 2001 From: TheFox0x7 Date: Thu, 9 Jan 2025 02:21:47 +0100 Subject: 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 --- modules/analyze/vendor_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modules/analyze') diff --git a/modules/analyze/vendor_test.go b/modules/analyze/vendor_test.go index aafd3c431b..02a51d4c8f 100644 --- a/modules/analyze/vendor_test.go +++ b/modules/analyze/vendor_test.go @@ -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) }) } } -- cgit v1.2.3