Skip to content

Commit

Permalink
test(yamlls): test shouldRun
Browse files Browse the repository at this point in the history
  • Loading branch information
qvalentin committed Jul 8, 2024
1 parent f752621 commit 08b2b69
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions internal/adapter/yamlls/yamlls_test.go
Original file line number Diff line number Diff line change
@@ -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")))
}

0 comments on commit 08b2b69

Please sign in to comment.