testutils

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertTestUser added in v1.0.8

func InsertTestUser(t *testing.T, userID string)

InsertTestUser inserts a minimal valid user row so that foreign-key constraints on user_id are satisfied in tests that don't exercise the user package directly.

func MockApiRequestWithAuth

func MockApiRequestWithAuth(t *testing.T, body, method, url string, handler RouteHandler, token string) *httptest.ResponseRecorder

func MockFormRequest

func MockFormRequest(t *testing.T, formData map[string]string, method, uri string, handler RouteHandler) *httptest.ResponseRecorder

func MockJSONRequest

func MockJSONRequest(t *testing.T, body, method, url string, handler RouteHandler) []byte

func WithConfigOverride

func WithConfigOverride(t *testing.T, override func())

func WithTestDB

func WithTestDB(t *testing.T)

Types

type RouteHandler

type RouteHandler func(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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