testutil

package
v0.21.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountEmailJobs added in v0.21.0

func CountEmailJobs(
	t testing.TB,
	ctx context.Context,
	toEmail string,
	template domain.EmailTemplate,
) int

func CountEmailJobsWithTemplateDataValue added in v0.21.0

func CountEmailJobsWithTemplateDataValue(
	t testing.TB,
	ctx context.Context,
	toEmail string,
	template domain.EmailTemplate,
	variable string,
	value string,
) int

func LatestEmailTemplateData added in v0.21.0

func LatestEmailTemplateData(
	t testing.TB,
	ctx context.Context,
	toEmail string,
	template domain.EmailTemplate,
) email.TemplateData

func WithRollbackTx

func WithRollbackTx(t *testing.T, tdb *TestDB, fn func(ctx context.Context))

Types

type Clock

type Clock interface {
	Now() time.Time
}

type FakeClock

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

func NewFakeClock

func NewFakeClock(start time.Time) *FakeClock

func (*FakeClock) Advance

func (f *FakeClock) Advance(d time.Duration)

func (*FakeClock) Now

func (f *FakeClock) Now() time.Time

func (*FakeClock) Set

func (f *FakeClock) Set(t time.Time)

type RealClock

type RealClock struct{}

func (RealClock) Now

func (RealClock) Now() time.Time

type TestDB

type TestDB struct {
	Store *store.Store
	Tx    *tx.Manager
}

func OpenTestDB

func OpenTestDB(t *testing.T) *TestDB

Jump to

Keyboard shortcuts

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