apptest

package
v0.0.0-...-2379ac9 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultIsRunning

func DefaultIsRunning(line string) bool

DefaultIsRunning looks for lines in Fx's log output, which match either the ConsoleLogger or the ZapLogger's output, and represent that the application is running and ready to receive requests.

func Start

func Start(t test.T, main func(), options ...StartOption)

Start starts the Fx application that main represents, and blocks until isRunning(line) reports true for a line of output. When the test exits, this signals for the application to stop, and waits for it to stop.

Types

type StartOption

type StartOption interface {
	// contains filtered or unexported methods
}

StartOption is an option for the Start function.

func IsRunning

func IsRunning(f func(string) bool) StartOption

IsRunning customizes how Start determines whether a log statement represents a running application.

Defaults to DefaultIsRunning.

func Timeout

func Timeout(t time.Duration) StartOption

Timeout specifies the duration after which we'll stop waiting for the application to start up.

Defaults to 5s.

Jump to

Keyboard shortcuts

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