snaptest

package
v2.932.13 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoTestSnapshot

func DoTestSnapshot(t *testing.T, opts Options)

DoTestSnapshot runs a snapshot test with the given options

Types

type GenerateReport

type GenerateReport struct {
	MissingExpected   []string
	GenerationErrors  []error
	CompilationErrors []error
	LintErrors        []error
	IgnoredCompile    []error
	IgnoredLint       []error
}

func (GenerateReport) HasFailures

func (r GenerateReport) HasFailures() bool

type Options

type Options struct {
	Spec         string
	GenYaml      string
	IncludeGlobs []string
	// ExcludeGlobs lists path patterns that must NOT exist after generation.
	// A trailing "/**" matches everything beneath a directory (e.g. "docs/**");
	// otherwise filepath.Match semantics apply to the slash-relative path. Any
	// match fails the test. Useful for asserting a feature suppressed output —
	// e.g. `generation.documentation: none` skipping `docs/**`.
	ExcludeGlobs  []string
	Expected      string
	GenOpts       []generate.GeneratorOptions
	AfterGenerate func(t *testing.T, tempDir string)
	ExpectErrors  []string
	ShouldCompile *bool
}

Options holds the configuration for a snapshot test

Jump to

Keyboard shortcuts

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