snaptest

package
v2.968.13 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func WriteGenYaml added in v2.961.0

func WriteGenYaml(t *testing.T, dir, genYaml string) (string, string)

WriteGenYaml writes dir/.speakeasy/gen.yaml with genYaml merged over the default configuration of the target it configures, returning the target and the written path.

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