mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-03-07 10:58:16 +00:00
Initial commit
This commit is contained in:
28
internal/internal_validator_test.go
Normal file
28
internal/internal_validator_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package internal
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestValidateActionYML_Required(t *testing.T) {
|
||||
|
||||
a := &ActionYML{
|
||||
Name: "",
|
||||
Description: "",
|
||||
Runs: map[string]any{},
|
||||
}
|
||||
res := ValidateActionYML(a)
|
||||
if len(res.MissingFields) == 0 {
|
||||
t.Error("should detect missing fields")
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateActionYML_Valid(t *testing.T) {
|
||||
a := &ActionYML{
|
||||
Name: "MyAction",
|
||||
Description: "desc",
|
||||
Runs: map[string]any{"using": "node12"},
|
||||
}
|
||||
res := ValidateActionYML(a)
|
||||
if len(res.MissingFields) != 0 {
|
||||
t.Errorf("expected no missing fields, got %v", res.MissingFields)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user