Documentation
¶
Index ¶
- func AssertJSONResponse(t *testing.T, resp *http.Response, expectedFields map[string]interface{})
- func AssertNoError(t *testing.T, err error)
- func AssertResponseContains(t *testing.T, resp *http.Response, expected string)
- func AssertStatus(t *testing.T, expected, actual int)
- func RunTestScenarios(t *testing.T, ts *TestServer, scenarios []TestScenario)
- func WaitForCondition(t *testing.T, condition func() bool, timeout time.Duration, message string)
- type MockRequest
- type TestScenario
- type TestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertJSONResponse ¶
AssertJSONResponse checks if response contains expected JSON fields
func AssertNoError ¶
AssertNoError checks that error is nil
func AssertResponseContains ¶
AssertResponseContains checks if response body contains expected string
func AssertStatus ¶
AssertStatus checks if the response has the expected status code
func RunTestScenarios ¶
func RunTestScenarios(t *testing.T, ts *TestServer, scenarios []TestScenario)
RunTestScenarios runs multiple test scenarios
Types ¶
type MockRequest ¶
MockRequest creates a mock HTTP request for testing
func (*MockRequest) ToHTTPRequest ¶
func (mr *MockRequest) ToHTTPRequest() (*http.Request, error)
ToHTTPRequest converts MockRequest to http.Request
type TestScenario ¶
type TestScenario struct { Name string Request MockRequest ExpectedStatus int ExpectedFields map[string]interface{} ExpectedError bool }
TestScenario represents a test scenario
type TestServer ¶
TestServer represents a test server with all plugins loaded
func (*TestServer) Close ¶
func (ts *TestServer) Close()
Click to show internal directories.
Click to hide internal directories.