servertest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run[F Fixture](t *testing.T, testcases ...Case[F])

Types

type Case

type Case[F Fixture] struct {
	Name       string
	Req        *http.Request
	Options    []FixtureOption[F]
	Skip       bool
	WantStatus int
	WantBody   string
	Assert     []func(*testing.T, *http.Response)
}

type Fixture

type Fixture interface {
	Handler(*testing.T) http.Handler
}

type FixtureOption

type FixtureOption[F Fixture] func(*testing.T, *F)

Jump to

Keyboard shortcuts

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