Skip to content

Commit

Permalink
test: Checks if the markdown docs file has been generated
Browse files Browse the repository at this point in the history
  • Loading branch information
nszilard committed Jan 17, 2022
1 parent 786a052 commit a1b1bdf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/cmdDocs_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"fmt"
"os"
"testing"

Expand All @@ -16,7 +17,13 @@ func Test_generateMarkdown(t *testing.T) {
docsLocation = folder
defer os.RemoveAll(folder)

if err := generateMarkdown(&cobra.Command{Use: "test"}, nil); err != nil {
err = generateMarkdown(&cobra.Command{Use: "test", DisableAutoGenTag: true}, nil)
if err != nil {
t.Errorf("docs: unexpected error: %v", err)
}

_, err = os.ReadFile(fmt.Sprintf("%v/%v", folder, "test.md"))
if err != nil {
t.Errorf("docs: unexpected error reading generated md file: %v", err)
}
}

0 comments on commit a1b1bdf

Please sign in to comment.