testutil

package
v0.0.0-...-ebae57e Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testutil provides small helpers for HTTP handler and end-to-end tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(t *testing.T, rr *httptest.ResponseRecorder, dst any)

DecodeJSON unmarshals the response body into dst.

func DoJSON

func DoJSON(t *testing.T, e *echo.Echo, method, path string, body any) *httptest.ResponseRecorder

DoJSON performs an HTTP request against the echo server with a JSON body. The body value is marshaled to JSON; pass nil for an empty body.

func NewRequest

func NewRequest(method, target string, body io.Reader) *http.Request

NewRequest builds an HTTP request with JSON content-type for use with echo.

Types

This section is empty.

Jump to

Keyboard shortcuts

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