Documentation
¶
Index ¶
- func AssertHTTPStatus(t *testing.T, r *httptest.ResponseRecorder, expectedStatus ...int)
- func DecodeError(t *testing.T, s []byte) string
- func DecodeResponse(t *testing.T, r *httptest.ResponseRecorder, target interface{})
- func LoadTestFile(t *testing.T, filePath string) (*bytes.Buffer, map[string]string)
- func Request(t *testing.T, method, reqURL string, body any, headers ...map[string]string) httptest.ResponseRecorder
- func TmpFile(t *testing.T) string
- type APIResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertHTTPStatus ¶ added in v4.2.0
func AssertHTTPStatus(t *testing.T, r *httptest.ResponseRecorder, expectedStatus ...int)
AssertHTTPStatus verifies that the HTTP response status is correct
func DecodeResponse ¶ added in v4.2.0
func DecodeResponse(t *testing.T, r *httptest.ResponseRecorder, target interface{})
DecodeResponse decodes an HTTP response into a target struct.
func LoadTestFile ¶ added in v4.2.0
LoadTestFile loads a test file from the testdata directory
File contents are returned as a buffer and a map for the HTTP request headers
Types ¶
type APIResponse ¶
Click to show internal directories.
Click to hide internal directories.