Documentation
¶
Index ¶
- func AssertLogContains(t *testing.T, output string, expected []string)
- func AssertRequestHeader(t *testing.T, req RecordedRequest, header, expected string)
- func AssertRequestMethodAndPath(t *testing.T, req RecordedRequest, method, path string)
- func DumpRequests(t *testing.T, requests []RecordedRequest)
- func JSON(w http.ResponseWriter, status int, v any)
- func MockSuccessResponse() http.HandlerFunc
- func RunCLI(t *testing.T, args []string, env []string, timeout time.Duration) (stdout, stderr string, exitErr error)
- func StartMockServer(t *testing.T, handler http.HandlerFunc) (*httptest.Server, func() []RecordedRequest, func())
- func StartMockServerWithRecording(t *testing.T, handler http.HandlerFunc) (*httptest.Server, func() []RecordedRequest, func())
- func WithError(statusCode int, message string) http.HandlerFunc
- type RecordedRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertLogContains ¶
AssertLogContains checks if the output contains all expected strings
func AssertRequestHeader ¶
func AssertRequestHeader(t *testing.T, req RecordedRequest, header, expected string)
AssertRequestHeader verifies a request has the expected header value
func AssertRequestMethodAndPath ¶
func AssertRequestMethodAndPath(t *testing.T, req RecordedRequest, method, path string)
AssertRequestMethodAndPath verifies a request has the expected method and path
func DumpRequests ¶
func DumpRequests(t *testing.T, requests []RecordedRequest)
DumpRequests prints all recorded requests for debugging
func MockSuccessResponse ¶
func MockSuccessResponse() http.HandlerFunc
MockSuccessResponse returns a handler that always returns a success response
func RunCLI ¶
func RunCLI(t *testing.T, args []string, env []string, timeout time.Duration) (stdout, stderr string, exitErr error)
RunCLI executes the Pipeleek CLI binary with args, capturing stdout/stderr, with timeout
func StartMockServer ¶
func StartMockServer(t *testing.T, handler http.HandlerFunc) (*httptest.Server, func() []RecordedRequest, func())
StartMockServer creates a new HTTP test server with request recording
func StartMockServerWithRecording ¶
func StartMockServerWithRecording(t *testing.T, handler http.HandlerFunc) (*httptest.Server, func() []RecordedRequest, func())
StartMockServerWithRecording is an alias for StartMockServer for compatibility
Types ¶
Click to show internal directories.
Click to hide internal directories.