Files
gh-action-readme/internal/internal_template_test.go
2025-07-30 19:17:36 +03:00

25 lines
523 B
Go

package internal
import (
"testing"
)
func TestRenderReadme(t *testing.T) {
action := &ActionYML{
Name: "MyAction",
Description: "desc",
Inputs: map[string]ActionInput{
"foo": {Description: "Foo input", Required: true},
},
}
tmpl := "../templates/readme.tmpl"
opts := TemplateOptions{TemplatePath: tmpl, Format: "md"}
out, err := RenderReadme(action, opts)
if err != nil {
t.Fatalf("render failed: %v", err)
}
if len(out) < 10 || out[0:1] != "#" {
t.Error("unexpected output content")
}
}