enttest

package
v0.13.52 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientForTest

func ClientForTest(t testing.TB, opts ...ent.Option) *ent.Client

func NewClient added in v0.13.52

func NewClient(t TestingT, opts ...Option) *ent.Client

NewClient calls ent.NewClient and auto-run migration.

func Open added in v0.13.52

func Open(t TestingT, driverName, dataSourceName string, opts ...Option) *ent.Client

Open calls ent.Open and auto-run migration.

func ResetTables

func ResetTables(t testing.TB, client *ent.Client)

func StartDockertest added in v0.11.14

func StartDockertest(t testing.TB) string

Types

type Option added in v0.13.52

type Option func(*options)

Option configures client creation.

func WithMigrateOptions added in v0.13.52

func WithMigrateOptions(opts ...schema.MigrateOption) Option

WithMigrateOptions forwards options to auto migration.

func WithOptions added in v0.13.52

func WithOptions(opts ...ent.Option) Option

WithOptions forwards options to client creation.

type TestingT added in v0.13.52

type TestingT interface {
	FailNow()
	Error(...any)
}

TestingT is the interface that is shared between testing.T and testing.B and used by enttest.

Jump to

Keyboard shortcuts

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