testx

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockClock

func MockClock(t *testing.T) *clock.Mock

func MockEventsGetAll

func MockEventsGetAll[T events.Event](t *testing.T, m *MockEvents, predicates ...func(T) bool) []T

func MockEventsGetSingle

func MockEventsGetSingle[T events.Event](t *testing.T, m *MockEvents, predicates ...func(T) bool) T

func MockEventsHasNone

func MockEventsHasNone[T events.Event](t *testing.T, m *MockEvents, predicates ...func(T) bool)

func MockEventsHasSome

func MockEventsHasSome[T events.Event](t *testing.T, m *MockEvents, predicates ...func(T) bool) []T

func MustTransact

func MustTransact(t *testing.T, db *sqlx.DB, fn func(ctx ql.TxContext))

func MustTransactErr

func MustTransactErr(t *testing.T, db *sqlx.DB, fn func(ctx ql.TxContext) error)

func NewConnection

func NewConnection(t *testing.T, schemaTable string) *sqlx.DB

NewConnection creates a temporary postgres database and applies schema files from the ./sql directory.

Types

type MockEvents

type MockEvents struct {
	Testing *testing.T
	Events  []events.Event
}

func CaptureEvents

func CaptureEvents(t *testing.T) *MockEvents

func (*MockEvents) Close

func (m *MockEvents) Close() error

func (*MockEvents) SendAsync

func (m *MockEvents) SendAsync(_ context.Context, event events.Event)

func (*MockEvents) SendInTx

func (m *MockEvents) SendInTx(ctx context.Context, _ sqlx.ExecerContext, event events.Event) error

Jump to

Keyboard shortcuts

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