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

Function Test_printHostHints

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

Source from the content-addressed store, hash-verified

2365}
2366
2367func Test_printHostHints(t *testing.T) {
2368 kiro := &registry.AgentHost{ID: "kiro-cli", Name: "Kiro CLI", ProjectDir: ".kiro/skills", UserDir: ".kiro/skills"}
2369 copilot := &registry.AgentHost{ID: "copilot-cli", Name: "GitHub Copilot CLI", ProjectDir: ".github/skills"}
2370
2371 tests := []struct {
2372 name string
2373 hosts []*registry.AgentHost
2374 installed []string
2375 installDir string
2376 gitRoot string
2377 wantSub []string
2378 wantNot []string
2379 }{
2380 {
2381 name: "no installs produces no output",
2382 hosts: []*registry.AgentHost{kiro},
2383 installed: nil,
2384 installDir: "/repo/.kiro/skills",
2385 gitRoot: "/repo",
2386 wantNot: []string{"Kiro CLI"},
2387 },
2388 {
2389 name: "non-kiro host produces no output",
2390 hosts: []*registry.AgentHost{copilot},
2391 installed: []string{"s1"},
2392 installDir: "/repo/.github/skills",
2393 gitRoot: "/repo",
2394 wantNot: []string{"Kiro CLI"},
2395 },
2396 {
2397 name: "kiro project scope uses relative path",
2398 hosts: []*registry.AgentHost{kiro},
2399 installed: []string{"s1"},
2400 installDir: filepath.Join("/repo", ".kiro", "skills"),
2401 gitRoot: "/repo",
2402 wantSub: []string{"Kiro CLI", `"skill://.kiro/skills/**/SKILL.md"`},
2403 },
2404 {
2405 name: "kiro user scope uses absolute install dir",
2406 hosts: []*registry.AgentHost{kiro},
2407 installed: []string{"s1"},
2408 installDir: "/home/user/.kiro/skills",
2409 gitRoot: "/repo",
2410 wantSub: []string{`"skill:///home/user/.kiro/skills/**/SKILL.md"`},
2411 wantNot: []string{`skill://.kiro/skills`},
2412 },
2413 {
2414 name: "kiro custom dir outside git root uses absolute path",
2415 hosts: []*registry.AgentHost{kiro},
2416 installed: []string{"s1"},
2417 installDir: "/tmp/my-skills",
2418 gitRoot: "/repo",
2419 wantSub: []string{`"skill:///tmp/my-skills/**/SKILL.md"`},
2420 },
2421 {
2422 name: "kiro without git root falls back to install dir",
2423 hosts: []*registry.AgentHost{kiro},
2424 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