testhelpers

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockClient

func NewMockClient(t *testing.T, handler http.Handler) *client.Client

NewMockClient creates a test HTTP server with automatic OAuth2 token handling and returns a configured *client.Client pointed at the mock server. The provided handler receives all non-token requests. The server is automatically closed when the test completes.

func RespondJSON

func RespondJSON(w http.ResponseWriter, status int, body any)

RespondJSON writes a JSON response with the given status code and body.

Types

This section is empty.

Jump to

Keyboard shortcuts

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