httptester

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, router chi.Router, testCases []TestCase)

Types

type TestCase

type TestCase struct {
	Name           string // Name of this test
	URL            string // URL to test
	Method         string // HTTP method to use
	Body           string // Body to send (if POST etc)
	CheckBody      string // Regex to check for in response body
	CheckBodyCount int    // Number of times regex should match
	CheckStatus    int    // Expected HTTP status code
}

Jump to

Keyboard shortcuts

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