Added test for lint mode

Signed-off-by: Marcus Speight <marcus.speight@hotmail.co.uk>
pull/9035/head
Marcus Speight 4 years ago committed by Marcus Speight
parent 7a0739a863
commit 8aa42824f9

@ -289,7 +289,7 @@ func TestExecErrors(t *testing.T) {
func TestFailErrors(t *testing.T) {
vals := chartutil.Values{"Values": map[string]interface{}{}}
failtpl := `{{ fail "This is an error" }}`
failtpl := `All your base are belong to us{{ fail "This is an error" }}`
tplsFailed := map[string]renderable{
"failtpl": {tpl: failtpl, vals: vals},
}
@ -301,6 +301,18 @@ func TestFailErrors(t *testing.T) {
if err.Error() != expected {
t.Errorf("Expected '%s', got %q", expected, err.Error())
}
var e Engine
e.LintMode = true
out, err := e.render(tplsFailed)
if err != nil {
t.Fatal(err)
}
expectStr := "All your base are belong to us"
if gotStr := out["failtpl"]; gotStr != expectStr {
t.Errorf("Expected %q, got %q (%v)", expectStr, gotStr, out)
}
}
func TestAllTemplates(t *testing.T) {

Loading…
Cancel
Save