Skip to content

Commit c3d1a13

Browse files
committed
test(skills): end-to-end test for tips in GenSkillsDir
1 parent 9f5aab6 commit c3d1a13

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

doc/cmd_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ var echoCmd = &cobra.Command{
5757
Short: "Echo anything to the screen",
5858
Long: "an utterly useless command for testing",
5959
Example: "Just run cobra-test echo",
60+
Annotations: map[string]string{
61+
"skills:tip:output": "Supports JSON output via -o json.",
62+
},
6063
}
6164

6265
var echoSubCmd = &cobra.Command{

doc/skills_docs_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ func TestGenSkillsDir(t *testing.T) {
141141
checkStringContains(t, echoContent, echoCmd.Long)
142142
checkStringContains(t, echoContent, echoCmd.Example)
143143
checkStringContains(t, echoContent, "boolone")
144+
checkStringContains(t, echoContent, "### Tips")
145+
checkStringContains(t, echoContent, "- Supports JSON output via -o json.")
144146

145147
timesRef, err := os.ReadFile(filepath.Join(refDir, "root_echo_times.md"))
146148
if err != nil {
@@ -150,6 +152,7 @@ func TestGenSkillsDir(t *testing.T) {
150152
checkStringContains(t, timesContent, "# root echo times")
151153
checkStringContains(t, timesContent, timesCmd.Short)
152154
checkStringContains(t, timesContent, "Options inherited from parent commands")
155+
checkStringOmits(t, timesContent, "### Tips")
153156
}
154157

155158
func TestGenSkillsDirDefaultName(t *testing.T) {

0 commit comments

Comments
 (0)