rootertest

package
v0.0.0-...-2d52d2e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(t *testing.T, handler http.Handler, testCases []TestCase)

Test all the provided test cases

Types

type TestCase

type TestCase struct {
	// Test Name
	Name string
	// Request
	Request    *http.Request
	Method     string
	URL        string
	Body       io.Reader
	RequestMod func(req *http.Request)
	// Response Checks
	TargetStatusCode       int
	TargetResponseBytes    []byte
	SkipResponseBytesCheck bool
	CustomResponseChecker  func(t *testing.T, response *http.Response)
}

TestCase to be tested

Jump to

Keyboard shortcuts

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