Documentation ¶
Overview ¶
Package testhelper has common helpers for tests
Index ¶
- func LogfilePath(filename string) string
- func NewConfigWithTimeout(timeout time.Duration) *config.Config
- func NewTestLogger() (obs *observer.ObservedLogs, log *zap.SugaredLogger)
- func NewTestLoggerWithPath(path string) (obs *observer.ObservedLogs, log *zap.SugaredLogger)
- func RandString(n int) string
- func WaitForPort(host, port string, timeOut time.Duration) error
- type CallQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogfilePath ¶
LogfilePath returns the path for the given filename in the testing tmp directory
func NewConfigWithTimeout ¶
NewConfigWithTimeout returns a default config, with a context timeout
func NewTestLogger ¶
func NewTestLogger() (obs *observer.ObservedLogs, log *zap.SugaredLogger)
NewTestLogger returns a ZAP logger for assertions, which also logs to <tmpdir>/quarks-tests.log
func NewTestLoggerWithPath ¶
func NewTestLoggerWithPath(path string) (obs *observer.ObservedLogs, log *zap.SugaredLogger)
NewTestLoggerWithPath returns a logger which logs to path
Types ¶
type CallQueue ¶
type CallQueue struct {
// contains filtered or unexported fields
}
CallQueue represents a list of expected function calls
func NewCallQueue ¶
func NewCallQueue(funcs ...expectFunc) CallQueue
NewCallQueue returns a new list of expected functions
Click to show internal directories.
Click to hide internal directories.