MCPcopy
hub / github.com/cli/cli / Test_printHostHints

Function Test_printHostHints

pkg/cmd/skills/install/install_test.go:2343–2422  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2341}
2342
2343func Test_printHostHints(t *testing.T) {
2344 kiro := &registry.AgentHost{ID: "kiro-cli", Name: "Kiro CLI", ProjectDir: ".kiro/skills", UserDir: ".kiro/skills"}
2345 copilot := &registry.AgentHost{ID: "copilot-cli", Name: "GitHub Copilot CLI", ProjectDir: ".github/skills"}
2346
2347 tests := []struct {
2348 name string
2349 hosts []*registry.AgentHost
2350 installed []string
2351 installDir string
2352 gitRoot string
2353 wantSub []string
2354 wantNot []string
2355 }{
2356 {
2357 name: "no installs produces no output",
2358 hosts: []*registry.AgentHost{kiro},
2359 installed: nil,
2360 installDir: "/repo/.kiro/skills",
2361 gitRoot: "/repo",
2362 wantNot: []string{"Kiro CLI"},
2363 },
2364 {
2365 name: "non-kiro host produces no output",
2366 hosts: []*registry.AgentHost{copilot},
2367 installed: []string{"s1"},
2368 installDir: "/repo/.github/skills",
2369 gitRoot: "/repo",
2370 wantNot: []string{"Kiro CLI"},
2371 },
2372 {
2373 name: "kiro project scope uses relative path",
2374 hosts: []*registry.AgentHost{kiro},
2375 installed: []string{"s1"},
2376 installDir: filepath.Join("/repo", ".kiro", "skills"),
2377 gitRoot: "/repo",
2378 wantSub: []string{"Kiro CLI", `"skill://.kiro/skills/**/SKILL.md"`},
2379 },
2380 {
2381 name: "kiro user scope uses absolute install dir",
2382 hosts: []*registry.AgentHost{kiro},
2383 installed: []string{"s1"},
2384 installDir: "/home/user/.kiro/skills",
2385 gitRoot: "/repo",
2386 wantSub: []string{`"skill:///home/user/.kiro/skills/**/SKILL.md"`},
2387 wantNot: []string{`skill://.kiro/skills`},
2388 },
2389 {
2390 name: "kiro custom dir outside git root uses absolute path",
2391 hosts: []*registry.AgentHost{kiro},
2392 installed: []string{"s1"},
2393 installDir: "/tmp/my-skills",
2394 gitRoot: "/repo",
2395 wantSub: []string{`"skill:///tmp/my-skills/**/SKILL.md"`},
2396 },
2397 {
2398 name: "kiro without git root falls back to install dir",
2399 hosts: []*registry.AgentHost{kiro},
2400 installed: []string{"s1"},

Callers

nothing calls this directly

Calls 7

TestFunction · 0.92
printHostHintsFunction · 0.85
JoinMethod · 0.80
ColorSchemeMethod · 0.80
ContainsMethod · 0.80
RunMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected