MCPcopy Create free account
hub / github.com/github/gh-aw / TestLSPManagerGenerateInstallSteps

Function TestLSPManagerGenerateInstallSteps

pkg/workflow/lsp_manager_test.go:87–110  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestLSPManagerGenerateInstallSteps(t *testing.T) {
88 manager := NewLSPManager(map[string]LSPServerConfig{
89 "typescript": {
90 Command: "typescript-language-server",
91 FileExtensions: map[string]string{
92 ".ts": "typescript",
93 },
94 },
95 "unknown": {
96 Command: "my-lsp",
97 FileExtensions: map[string]string{
98 ".foo": "foo",
99 },
100 },
101 })
102
103 // Default: --ignore-scripts + cooldown enabled + pinned versions
104 steps := manager.GenerateInstallSteps(nil)
105 require.Len(t, steps, 1)
106 content := strings.Join(steps[0], "\n")
107 assert.Contains(t, content, "Install TypeScript LSP dependencies")
108 assert.Contains(t, content, "npm install -g --ignore-scripts typescript@5.8.3 typescript-language-server@4.3.3")
109 assert.Contains(t, content, "NPM_CONFIG_MIN_RELEASE_AGE")
110}
111
112func TestLSPManagerGenerateInstallSteps_RunInstallScripts(t *testing.T) {
113 // When run-install-scripts is enabled, --ignore-scripts must be omitted.

Callers

nothing calls this directly

Calls 2

GenerateInstallStepsMethod · 0.95
NewLSPManagerFunction · 0.85

Tested by

no test coverage detected