MCPcopy Create free account
hub / github.com/cli/cli / TestFindByID

Function TestFindByID

internal/skills/registry/registry_test.go:11–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestFindByID(t *testing.T) {
12 tests := []struct {
13 name string
14 id string
15 wantName string
16 wantErr string
17 }{
18 {name: "github-copilot", id: "github-copilot", wantName: "GitHub Copilot"},
19 {name: "claude-code", id: "claude-code", wantName: "Claude Code"},
20 {name: "cursor", id: "cursor", wantName: "Cursor"},
21 {name: "codex", id: "codex", wantName: "Codex"},
22 {name: "gemini-cli", id: "gemini-cli", wantName: "Gemini CLI"},
23 {name: "antigravity", id: "antigravity", wantName: "Antigravity"},
24 {name: "antigravity-cli", id: "antigravity-cli", wantName: "Antigravity CLI"},
25 {name: "antigravity2.0", id: "antigravity2.0", wantName: "Antigravity 2.0"},
26 {name: "devin", id: "devin", wantName: "Devin"},
27 {name: "grok", id: "grok", wantName: "Grok"},
28 {name: "windsurf is no longer supported", id: "windsurf", wantErr: "unknown agent"},
29 {name: "unknown agent", id: "nonexistent", wantErr: "unknown agent"},
30 }
31 for _, tt := range tests {
32 t.Run(tt.name, func(t *testing.T) {
33 host, err := FindByID(tt.id)
34 if tt.wantErr != "" {
35 require.Error(t, err)
36 assert.Contains(t, err.Error(), tt.wantErr)
37 return
38 }
39 require.NoError(t, err)
40 assert.Equal(t, tt.wantName, host.Name)
41 })
42 }
43}
44
45func TestInstallDir(t *testing.T) {
46 t.Setenv(claudeConfigDirEnv, "")

Callers

nothing calls this directly

Calls 5

FindByIDFunction · 0.85
ContainsMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected