(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func 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 | |
| 112 | func TestLSPManagerGenerateInstallSteps_RunInstallScripts(t *testing.T) { |
| 113 | // When run-install-scripts is enabled, --ignore-scripts must be omitted. |
nothing calls this directly
no test coverage detected