test

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(t *testing.T, tc TestCase)

func WriteTestFile added in v0.6.0

func WriteTestFile(t *testing.T, contents io.Reader) (string, error)

WriteTestFile writes the provided contents from the reader into a newly created random-named file inside t.TempDir(). The created file has restrictive permissions (0600). It returns the full path to the created file or an error.

func WriteTestFileWithName added in v0.6.0

func WriteTestFileWithName(t *testing.T, filename string, contents io.Reader) (string, error)

WriteTestFileWithName writes the provided contents from the reader into a file with the specified name inside t.TempDir(). The created file has restrictive permissions (0600). It returns the full path to the created file or an error.

Types

type Step

type Step struct {
	PreRun  func(TestContext) error
	Run     func(TestContext) error
	PostRun func(TestContext) error
	Verify  func(TestContext) error
}

Compact acc runner

type TestCase

type TestCase struct {
	PreCheck       func() error
	Steps          []Step
	AcceptanceTest bool
}

type TestContext

type TestContext interface {
	util.CmdContext
	Org() string
	OrgUrl() string
	PAT() string
	Project() string
	SetValue(key, value any)
	Value(key any) (any, bool)
}

func NewAccTestContext added in v0.7.0

func NewAccTestContext(t *testing.T) TestContext

Precheck and context builder

func NewTestContext added in v0.7.0

func NewTestContext(t *testing.T) TestContext

Jump to

Keyboard shortcuts

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