Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
App is a wrapper around fx.App that provides some testing helpers. By default, it uses the provided TB as the application's logging backend.
func (*App) RequireStart ¶
RequireStart calls Start, failing the test if an error is encountered.
func (*App) RequireStop ¶
func (app *App) RequireStop()
RequireStop calls Stop, failing the test if an error is encountered.
type Lifecycle ¶
type Lifecycle struct {
// contains filtered or unexported fields
}
Lifecycle is a testing spy for fx.Lifecycle. It exposes Start and Stop methods (and some test-specific helpers) so that unit tests can exercise hooks.
func (*Lifecycle) RequireStart ¶
RequireStart calls Start with context.Background(), failing the test if an error is encountered.
func (*Lifecycle) RequireStop ¶
func (l *Lifecycle) RequireStop()
RequireStop calls Stop with context.Background(), failing the test if an error is encountered.
func (*Lifecycle) Start ¶
Start executes all registered OnStart hooks in order, halting at the first hook that doesn't succeed.