beholdertest

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Observer

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

Observer is a test helper that provides assertion methods on received messages within the beholder client.

func NewObserver

func NewObserver(t *testing.T) Observer

NewObserver sets the global beholder client as a message collector and returns an Observer that provides helper assertion functions on received messages.

NewObserver affects the whole process, it cannot be used in parallel tests or tests with parallel ancestors.

func (Observer) BaseMessagesForLabels

func (o Observer) BaseMessagesForLabels(t *testing.T, labels map[string]string) ([]*pb.BaseMessage, error)

func (Observer) Len

func (o Observer) Len(t *testing.T, attrKVs ...any) int

Len returns the total number of messages received that match the provided attribute key/value pairs.

func (Observer) Messages

func (o Observer) Messages(t *testing.T, attrKVs ...any) []beholder.Message

Messages returns messages matching the provided keys and values.

Jump to

Keyboard shortcuts

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