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

Function Test_printHostHints

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

Source from the content-addressed store, hash-verified

2397}
2398
2399func Test_printHostHints(t *testing.T) {
2400 kiro := &registry.AgentHost{ID: "kiro-cli", Name: "Kiro CLI", ProjectDir: ".kiro/skills", UserDir: ".kiro/skills"}
2401 copilot := &registry.AgentHost{ID: "copilot-cli", Name: "GitHub Copilot CLI", ProjectDir: ".github/skills"}
2402
2403 tests := []struct {
2404 name string
2405 hosts []*registry.AgentHost
2406 installed []string
2407 installDir string
2408 gitRoot string
2409 wantSub []string
2410 wantNot []string
2411 }{
2412 {
2413 name: "no installs produces no output",
2414 hosts: []*registry.AgentHost{kiro},
2415 installed: nil,
2416 installDir: "/repo/.kiro/skills",
2417 gitRoot: "/repo",
2418 wantNot: []string{"Kiro CLI"},
2419 },
2420 {
2421 name: "non-kiro host produces no output",
2422 hosts: []*registry.AgentHost{copilot},
2423 installed: []string{"s1"},
2424 installDir: "/repo/.github/skills",
2425 gitRoot: "/repo",
2426 wantNot: []string{"Kiro CLI"},
2427 },
2428 {
2429 name: "kiro project scope uses relative path",
2430 hosts: []*registry.AgentHost{kiro},
2431 installed: []string{"s1"},
2432 installDir: filepath.Join("/repo", ".kiro", "skills"),
2433 gitRoot: "/repo",
2434 wantSub: []string{"Kiro CLI", `"skill://.kiro/skills/**/SKILL.md"`},
2435 },
2436 {
2437 name: "kiro user scope uses absolute install dir",
2438 hosts: []*registry.AgentHost{kiro},
2439 installed: []string{"s1"},
2440 installDir: "/home/user/.kiro/skills",
2441 gitRoot: "/repo",
2442 wantSub: []string{`"skill:///home/user/.kiro/skills/**/SKILL.md"`},
2443 wantNot: []string{`skill://.kiro/skills`},
2444 },
2445 {
2446 name: "kiro custom dir outside git root uses absolute path",
2447 hosts: []*registry.AgentHost{kiro},
2448 installed: []string{"s1"},
2449 installDir: "/tmp/my-skills",
2450 gitRoot: "/repo",
2451 wantSub: []string{`"skill:///tmp/my-skills/**/SKILL.md"`},
2452 },
2453 {
2454 name: "kiro without git root falls back to install dir",
2455 hosts: []*registry.AgentHost{kiro},
2456 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.65

Tested by

no test coverage detected