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

Function TestInitCommandInteractiveModeDetection

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

Source from the content-addressed store, hash-verified

162}
163
164func TestInitCommandInteractiveModeDetection(t *testing.T) {
165 t.Parallel()
166
167 // Test that interactive mode is triggered when no flags are set
168 // We can't test the actual interactive prompts in unit tests, but we can
169 // verify that the command structure supports the detection logic
170
171 cmd := NewInitCommand()
172
173 // Verify that all the flags exist that are checked for interactive mode detection
174 requiredFlags := []string{"mcp", "no-mcp", "no-skill", "no-agent", "codespaces", "completions", "create-pull-request", "pr"}
175 for _, flagName := range requiredFlags {
176 flag := cmd.Flags().Lookup(flagName)
177 if flag == nil {
178 t.Errorf("Expected flag %q to exist for interactive mode detection", flagName)
179 }
180 }
181}
182
183func TestInitRepositoryBasic(t *testing.T) {
184 tmpDir := testutil.TempDir(t, "test-*")

Callers

nothing calls this directly

Calls 2

NewInitCommandFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected