test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureLogsForTest

func CaptureLogsForTest() func() []string

CaptureLogsForTest adds a logging listener which captures messages to an internal channel. Returns a function that ends log capturing and returns any captured messages. It's safe to call endCapture() multiple times, so a simple call pattern is:

endCapture := CaptureLogsForTest()
defer endCapture()  // ensure cleanup in case of test assert failures

/* some test code */

messages := endCapture()
/* do inspection of log messages */

func CaptureLogsForTestWithChannel

func CaptureLogsForTestWithChannel(messagesCh chan string) func() []string

func EnableStdoutLogging

func EnableStdoutLogging()

EnableStdoutLogging turns on logging to stdout for diagnostics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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