Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyTester ¶
BodyTester is a function used to compare HTTP body contents. It is compatible with testify JSONEq assertion.
type RespTester ¶
type RespTester interface { // BodyTester sets function used to compare HTTP bodies. BodyTester(tester BodyTester) RespTester // Check checks if golden data matches ResponseRecorder. // Check panics if golden resp cannot be read or it cannot be unmarshaled. Check() RespTester // Save saves golden resp. // It panics if file cannot be marshaled or written. Save() RespTester }
RespTester represents golden resp tester.
func Resp ¶
func Resp(t *testing.T, path string, rec *httptest.ResponseRecorder) RespTester
Resp returns HTTP response golden resp tester.
Click to show internal directories.
Click to hide internal directories.