testutil

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug()

Debug enables or disables debug logging. If the DEBUG environment variable is set, debug logging is enabled. Otherwise, it is disabled.

func MockRequestJson

func MockRequestJson() (func() (string, string, string), request.RequestOption)

MockRequestJson returns a function which can be used with openapi.OpenApi to mock a request handler and inspect the response.

Example:

inspect, requestJson := MockRequestJson()
openApiInstance.With(requestJson)
openApiInstance.SomeEndpoint()
method, uri, body := inspect()

func RunTestsIfMatch

func RunTestsIfMatch(name string, packageSuite func(t *testing.T), t *testing.T)

RunTestsIfMatch allows us to declare tests that only run if a specific test suite is matched, by calling the package's test suite.

This is a workaround because Ginkgo only allows you to declare one suite per package.

func RunTestsWithFocus

func RunTestsWithFocus(m *testing.M)

RunTestsWithFocus allows us to define a TestMain which will only run tests that match the given `-test.run` flag. This is to make Ginkgo Focus work with the Golang test suite flags and the VSCode test runner.

func Trace

func Trace(args ...any)

Trace conditionally prints to stdout if DEBUG=trace is set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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