testhelper

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockAuthMiddleware added in v0.7.0

func MockAuthMiddleware(ctx *gin.Context)

MockAuthMiddleware mocks authentication by setting a default user context in the Gin context for testing purposes.

func NewJSONRequest

func NewJSONRequest(method, url string, bodyAsStruct any) (*http.Request, error)

NewJSONRequest wraps http.NewRequest and sets the passed struct as body

func VerifyResponseWithMetadata

func VerifyResponseWithMetadata[T any](
	t *testing.T,
	wantResponseCode int, wantResponseParsed T,
	gotResponse *httptest.ResponseRecorder)

Types

This section is empty.

Jump to

Keyboard shortcuts

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