diff --git a/internal/adapter/yamlls/yamlls_test.go b/internal/adapter/yamlls/yamlls_test.go new file mode 100644 index 0000000..feaa82c --- /dev/null +++ b/internal/adapter/yamlls/yamlls_test.go @@ -0,0 +1,31 @@ +package yamlls + +import ( + "testing" + + "github.com/mrjosh/helm-ls/internal/util" + "github.com/stretchr/testify/assert" + "go.lsp.dev/uri" +) + +func TestIsRelevantFile(t *testing.T) { + connector := Connector{ + config: util.YamllsConfiguration{ + Enabled: true, + EnabledForFileExtensions: []string{".yaml", ".yml"}, + }, + } + assert.True(t, connector.isRelevantFile(uri.File("test.yaml"))) + assert.False(t, connector.isRelevantFile(uri.File("_helpers.tpl"))) +} + +func TestShouldRun(t *testing.T) { + connector := Connector{ + config: util.YamllsConfiguration{ + Enabled: true, + EnabledForFileExtensions: []string{".yaml", ".yml"}, + }, + } + assert.False(t, connector.shouldRun(uri.File("test.yaml"))) + assert.False(t, connector.shouldRun(uri.File("_helpers.tpl"))) +}