testx

package
v2.5.10 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 12 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 {
	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(ctx context.Context, event events.Event)

func (*MockEvents) SendAsyncCh

func (m *MockEvents) SendAsyncCh() chan<- events.Event

func (*MockEvents) SendInTx

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

Jump to

Keyboard shortcuts

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