MCPcopy Create free account
hub / github.com/github/gh-aw / TestInitCommandHelp

Function TestInitCommandHelp

pkg/cli/init_command_test.go:128–162  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestInitCommandHelp(t *testing.T) {
129 t.Parallel()
130
131 cmd := NewInitCommand()
132
133 // Test that help can be generated without error
134 helpText := cmd.Long
135 if !strings.Contains(helpText, "Initialize") {
136 t.Error("Expected help text to contain 'Initialize'")
137 }
138
139 if !strings.Contains(helpText, ".gitattributes") {
140 t.Error("Expected help text to mention .gitattributes")
141 }
142
143 if !strings.Contains(helpText, ".github/agents/agentic-workflows.md") {
144 t.Error("Expected help text to mention the Agentic Workflows custom agent")
145 }
146
147 if !strings.Contains(helpText, ".github/skills/agentic-workflow-designer/SKILL.md") {
148 t.Error("Expected help text to mention the agentic workflow designer skill")
149 }
150
151 if !strings.Contains(helpText, "Copilot") {
152 t.Error("Expected help text to mention Copilot")
153 }
154
155 if !strings.Contains(helpText, "non-interactive repository setup") {
156 t.Error("Expected help text to mention non-interactive setup")
157 }
158
159 if strings.Contains(helpText, "Usage:") {
160 t.Error("Expected init long help text to not embed a Usage section")
161 }
162}
163
164func TestInitCommandInteractiveModeDetection(t *testing.T) {
165 t.Parallel()

Callers

nothing calls this directly

Calls 2

NewInitCommandFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected