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
Click to show internal directories.
Click to hide internal directories.