testutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFileContains

func AssertFileContains(t *testing.T, path string, expected string)

AssertFileContains checks that a file contains expected content.

func AssertFileExists

func AssertFileExists(t *testing.T, path string)

AssertFileExists checks that a file exists.

func AssertFileNotExists

func AssertFileNotExists(t *testing.T, path string)

AssertFileNotExists checks that a file does not exist.

func AssertGitTag

func AssertGitTag(t *testing.T, dir, tag string)

AssertGitTag checks that a git tag exists.

func CommitChanges

func CommitChanges(t *testing.T, dir, message string)

CommitChanges commits all changes in a test repo.

func SetupTestRepo

func SetupTestRepo(t *testing.T) string

SetupTestRepo creates a test repository in t.TempDir() with: - Multi-module Go structure (root + libA, libB, libC) - Initialized git repository with initial commit - Tags: v0.1.0, libA/v0.1.0, libB/v0.1.0, libC/v0.1.0 - .changeset directory with config and sample changeset

Types

type CLIResult

type CLIResult struct {
	ExitCode int
	Stdout   string
	Stderr   string
	Err      error
}

CLIResult captures the result of running a CLI command.

func RunCLI

func RunCLI(t *testing.T, dir string, cmd *cli.Command, args []string) CLIResult

RunCLI executes a CLI command in the given directory. Note: stdout is not captured to avoid test framework issues. Use Err field to check error messages.

Jump to

Keyboard shortcuts

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