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

Function TestUpgradeCommandHelpTextConsistency

pkg/cli/upgrade_command_test.go:12–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestUpgradeCommandHelpTextConsistency(t *testing.T) {
13 cmd := NewUpgradeCommand()
14 require.NotNil(t, cmd, "upgrade command should be created")
15
16 assert.Contains(t, cmd.Long, "Upgrade the repository to the latest version of agentic workflows.", "long description should use correct grammar")
17
18 approveFlag := cmd.Flags().Lookup("approve")
19 require.NotNil(t, approveFlag, "--approve flag should exist")
20 assert.Contains(t, approveFlag.Usage, "When strict mode is active", "--approve description should match compile semantics")
21
22 preReleasesFlag := cmd.Flags().Lookup("pre-releases")
23 require.NotNil(t, preReleasesFlag, "--pre-releases flag should exist")
24 assert.Contains(t, preReleasesFlag.Usage, "Include pre-release versions", "--pre-releases description should mention pre-release upgrades")
25 assert.Contains(t, preReleasesFlag.Usage, "installed by exact tag", "--pre-releases description should explain prerelease pinning")
26 assert.Contains(t, cmd.Example, "stable releases are the default", "help text should distinguish stable releases from prereleases")
27
28 disableCodemodFlag := cmd.Flags().Lookup("disable-codemod")
29 require.NotNil(t, disableCodemodFlag, "--disable-codemod flag should exist")
30 assert.Equal(t, "stringSlice", disableCodemodFlag.Value.Type())
31 assert.Contains(t, disableCodemodFlag.Usage, "Disable specific codemod IDs", "--disable-codemod usage should describe codemod exclusion")
32}

Callers

nothing calls this directly

Calls 1

NewUpgradeCommandFunction · 0.85

Tested by

no test coverage detected