testutil

package module
v0.0.0-...-df989e9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchResponseBody

func MatchResponseBody(t TestingT, handler http.Handler, req *http.Request, want []byte)

MatchResponseStatusCode tests if http.Response returns with expected body

func MatchResponseJSON

func MatchResponseJSON(t TestingT, handler http.Handler, req *http.Request, want any)

MatchResponseStatusCode tests if http.Response returns with expected JSON

func MatchResponseStatusCode

func MatchResponseStatusCode(t TestingT, handler http.Handler, req *http.Request, want int)

MatchResponseStatusCode tests if http.Response returns with expected status code

func ReadFile

func ReadFile(t TestingT, path string) []byte

ReadFile return bytes from file of the provided path

func TempWriter

func TempWriter(t TestingT, dir, pattern string) io.WriteCloser

TempWriter return io.WriteCloser backed a temp file

Types

type TestingT

type TestingT interface {
	Helper()
	Fatalf(string, ...any)
}

Jump to

Keyboard shortcuts

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