mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-03-20 02:02:48 +00:00
Initial commit
This commit is contained in:
24
internal/internal_template_test.go
Normal file
24
internal/internal_template_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user