Closes https://github.com/coder/internal/issues/531 ## Changes made - Added functionality to validate the structure of module README files (frontmatter and the README body) - Added a really basic snapshot-ish test for the module README body validation - Updated README files that were previously violating README requirements (the old modules validation logic wasn't catching these) - Changed `ValidationPhase` from an int to a string
23 lines
378 B
Go
23 lines
378 B
Go
package main
|
|
|
|
import (
|
|
_ "embed"
|
|
"testing"
|
|
)
|
|
|
|
//go:embed testSamples/sampleReadmeBody.md
|
|
var testBody string
|
|
|
|
func TestValidateCoderResourceReadmeBody(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
t.Run("Parses a valid README body with zero issues", func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
errs := validateCoderResourceReadmeBody(testBody)
|
|
for _, e := range errs {
|
|
t.Error(e)
|
|
}
|
|
})
|
|
}
|