krttest

package
v0.0.0-...-873615e Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockCollection

func GetMockCollection[T any](mc *MockCollection) krt.Collection[T]

func GetMockSingleton

func GetMockSingleton[T any](mc *MockCollection) krt.StaticSingleton[T]

Types

type MockCollection

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

func NewMock

func NewMock(t test.Failer, inputs []any) *MockCollection

NewMock creates a helper to build Collections of static inputs for use with testing. Example usage:

mock := krttest.NewMock(t, []any{serviceFoo, podBar, namespaceBaz})
pods := krttest.GetMockCollection[Pod](mock) // makes a collection of all Pod types from inputs

Jump to

Keyboard shortcuts

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