Documentation ¶
Overview ¶
Package ftltest contains test utilities for the ftl package.
Index ¶
- Constants
- func Context(options ...func(context.Context) error) context.Context
- func WhenVerb[Req any, Resp any](verb ftl.Verb[Req, Resp], ...) func(context.Context) error
- func WithConfig(name string, value any) func(context.Context) error
- func WithDSN(name string, dbType DBType, dsn string) func(context.Context) error
- func WithSecret(name string, value any) func(context.Context) error
- type DBType
Constants ¶
View Source
const (
DBTypePostgres = DBType(modulecontext.DBTypePostgres)
)
Variables ¶
This section is empty.
Functions ¶
func WhenVerb ¶ added in v0.189.0
func WhenVerb[Req any, Resp any](verb ftl.Verb[Req, Resp], fake func(ctx context.Context, req Req) (resp Resp, err error)) func(context.Context) error
WhenVerb replaces an implementation for a verb
To be used when setting up a context for a test: ctx := ftltest.Context(
ftltest.WhenVerb(Example.Verb, func(ctx context.Context, req Example.Req) (Example.Resp, error) { ... }), ... other options
)
func WithConfig ¶ added in v0.189.0
WithConfig sets a configuration for the current module
To be used with Context(...)
Types ¶
Click to show internal directories.
Click to hide internal directories.