Documentation ¶
Overview ¶
Package testjuice provides utility functions for testing HTTP responses and errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertResponse ¶
AssertResponse is a function that checks if the status code of an HTTP response matches the expected status code. It takes an expected status code, an HTTP response, and a response body as parameters. If the status code of the response does not match the expected status code, it returns an error with a message indicating the expected and actual status codes and the response body. If the status code of the response matches the expected status code, it returns nil.
func CheckErrorAndAbort ¶ added in v1.3.8
CheckErrorAndAbort is a function that checks if an error is not nil and aborts the test if it is. It takes a testing.T and an error as parameters. If the error is not nil, it calls t.FailNow, causing the test to abort.
func CheckErrorAndFail ¶
CheckErrorAndFail is a function that checks if an error is not nil and fails the test if it is. It takes a testing.T and an error as parameters. If the error is not nil, it calls t.Fatalf with the error message, causing the test to fail. This function is intended to be used with a test level (global) error field.
Types ¶
This section is empty.