testingutil

package
v0.0.0-...-1be23ea Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeJSON

func BeJSON[X any](expect string) testingx.Matcher[X]

func BeRequest

func BeRequest(expect string) testingx.Matcher[*http.Request]

func PrintJSON

func PrintJSON(v interface{})

func ProjectRoot

func ProjectRoot() string

func Serve

func Serve(t testing.TB, handler http.Handler) *httptest.Server

func ShouldReturnWhenRequest

func ShouldReturnWhenRequest(req any, expect string) testingx.Matcher[http.Handler]

Types

type Datetime

type Datetime time.Time

openapi:strfmt date-time

func (Datetime) IsZero

func (dt Datetime) IsZero() bool

func (Datetime) MarshalText

func (dt Datetime) MarshalText() ([]byte, error)

func (*Datetime) UnmarshalText

func (dt *Datetime) UnmarshalText(data []byte) error

type MockResponseWriter

type MockResponseWriter struct {
	StatusCode int
	bytes.Buffer
	// contains filtered or unexported fields
}

func NewMockResponseWriter

func NewMockResponseWriter() *MockResponseWriter

func (*MockResponseWriter) Header

func (w *MockResponseWriter) Header() http.Header

func (*MockResponseWriter) MustDumpResponse

func (w *MockResponseWriter) MustDumpResponse() []byte

func (*MockResponseWriter) Response

func (w *MockResponseWriter) Response() *http.Response

func (*MockResponseWriter) WriteHeader

func (w *MockResponseWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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