testutil

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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