stenciltest

package
v1.19.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package stenciltest contains code for testing templates

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

type Template struct {
	// contains filtered or unexported fields
}

Template is a template that is being tested by the stenciltest framework.

func New

func New(t *testing.T, templatePath string, additionalTemplates ...string) *Template

New creates a new test for a given template.

func (*Template) Args

func (t *Template) Args(args map[string]interface{}) *Template

Args sets the arguments to the template.

func (*Template) ErrorContains

func (t *Template) ErrorContains(msg string)

ErrorContains denotes that this test run should fail, and the message should contain the provided string.

t.ErrorContains("i am an error")

func (*Template) Run

func (t *Template) Run(save bool)

Run runs the test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL