Documentation ¶
Overview ¶
Package testutils is the Test utilities.
The functionality in this package is exposed both for internal testing as well as service testability.
InMemoryLogger ¶
If you'd like to verify that log messages are logged properly, use the WithInMemoryLogger() helper which will provider you with a zap.Logger you can pass into a service and capture recorded messages.
Overriding environment variables ¶
If you'd like to override environment variables, use the env.Override() helper and defer the reset to ensure the old value us returned at the end of the test.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StaticAppData ¶
StaticAppData creates a Provider for a valid appID/owner
Types ¶
type LockedBuffer ¶
LockedBuffer is a thread-safe log buffer for testing TODO: This will soon be moved to zap itself, file to be deleted soon
func GetLockedInMemoryLogger ¶
func GetLockedInMemoryLogger() (*zap.Logger, *LockedBuffer)
GetLockedInMemoryLogger creates an in-memory *zap.Logger that can be used in tests.
func (*LockedBuffer) Lines ¶
func (b *LockedBuffer) Lines() []string
Lines returns the lines that were logged