MCPcopy
hub / github.com/cli/cli / TestInstallDir

Function TestInstallDir

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

Source from the content-addressed store, hash-verified

40}
41
42func TestInstallDir(t *testing.T) {
43 t.Setenv(claudeConfigDirEnv, "")
44
45 tests := []struct {
46 name string
47 setup func(*testing.T)
48 hostID string
49 scope Scope
50 gitRoot string
51 homeDir string
52 wantDir string
53 wantErr bool
54 }{
55 {
56 name: "github copilot project scope",
57 hostID: "github-copilot",
58 scope: ScopeProject,
59 gitRoot: "/tmp/monalisa-repo",
60 homeDir: "/home/monalisa",
61 wantDir: filepath.Join("/tmp/monalisa-repo", ".agents", "skills"),
62 },
63 {
64 name: "github copilot user scope",
65 hostID: "github-copilot",
66 scope: ScopeUser,
67 gitRoot: "/tmp/monalisa-repo",
68 homeDir: "/home/monalisa",
69 wantDir: filepath.Join("/home/monalisa", ".copilot", "skills"),
70 },
71 {
72 name: "claude code project scope",
73 hostID: "claude-code",
74 scope: ScopeProject,
75 gitRoot: "/tmp/monalisa-repo",
76 homeDir: "/home/monalisa",
77 wantDir: filepath.Join("/tmp/monalisa-repo", ".claude", "skills"),
78 },
79 {
80 name: "claude code user scope",
81 hostID: "claude-code",
82 scope: ScopeUser,
83 gitRoot: "/tmp/monalisa-repo",
84 homeDir: "/home/monalisa",
85 wantDir: filepath.Join("/home/monalisa", ".claude", "skills"),
86 },
87 {
88 name: "claude code user scope, respect env var",
89 setup: func(t *testing.T) {
90 t.Setenv("CLAUDE_CONFIG_DIR", filepath.Join("/home", "monalisa", ".config", "claude"))
91 },
92 hostID: "claude-code",
93 scope: ScopeUser,
94 gitRoot: "/tmp/monalisa-repo",
95 homeDir: "/home/monalisa",
96 wantDir: filepath.Join("/home", "monalisa", ".config", "claude", "skills"),
97 },
98 {
99 name: "cursor project scope",

Callers

nothing calls this directly

Calls 6

FindByIDFunction · 0.85
JoinMethod · 0.80
InstallDirMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected