github.com/argoproj/argo-cd@v1.8.7/util/app/discovery/discovery_test.go (about) 1 package discovery 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestDiscover(t *testing.T) { 10 apps, err := Discover("./testdata") 11 assert.NoError(t, err) 12 assert.Equal(t, map[string]string{ 13 "foo": "Kustomize", 14 "bar": "Ksonnet", 15 "baz": "Helm", 16 }, apps) 17 } 18 19 func TestAppType(t *testing.T) { 20 appType, err := AppType("./testdata/foo") 21 assert.NoError(t, err) 22 assert.Equal(t, "Kustomize", appType) 23 24 appType, err = AppType("./testdata/bar") 25 assert.NoError(t, err) 26 assert.Equal(t, "Ksonnet", appType) 27 28 appType, err = AppType("./testdata/baz") 29 assert.NoError(t, err) 30 assert.Equal(t, "Helm", appType) 31 32 appType, err = AppType("./testdata") 33 assert.NoError(t, err) 34 assert.Equal(t, "Directory", appType) 35 }