Documentation ¶
Index ¶
- Variables
- func ApplicationOutputHasLines(expectedLines []string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func ApplicationOutputMatches(expectedLines []string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func AssertMapHasValues[T_Key comparable, T_Value interface{}](t *testing.T, subject map[T_Key]T_Value, values map[T_Key]T_Value)
- func AssertTimeDifferenceEqualOrMoreThanSeconds(t *testing.T, timeA, timeB time.Time, seconds int)
- func AssertTimeDifferenceLessThanSeconds(t *testing.T, timeA, timeB time.Time, seconds int)
- func BuildFormPayload(data map[string]string) io.Reader
- func CreateTmpEnvironment(entries ...FsEntry) string
- func EnvVarExists(varName string) bool
- func GetKeys[T_Key comparable, T_Value interface{}](subject map[T_Key]T_Value) []T_Key
- func HeaderKeysNotIncluded(headerKeys []string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func Headers(headerData ...string) http.Header
- func HeadersMatch(expectedHeaders http.Header) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func IndexOf[T comparable](list []T, value T) int
- func JsonMatches(expectedJson map[string]interface{}) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func LineEquals(lineNumber int, expectedLine string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func LineRegexMatches(lineNumber int, regex string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func MatchesFile(filePath string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func MkTemp(content []byte) string
- func MkTempNamed(fileName string, content []byte) string
- func MockAssert(assertOptions *mocklib.AssertOptions, serverOutput *bytes.Buffer, ...) []mocklib.ValidationError
- func Post(route string, headers http.Header, payload []byte) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func PostMultipart(route string, data map[string]string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func PostUrlEncodedForm(route string, data map[string]string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func RemoveUntestableDataFromFileserverHtmlOutput(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func RequestApiReset(config *mocklib.MockConfig)
- func RunMock(state *E2eState, command string) ([]byte, error)
- func RunTest(t *testing.T, configurationFilePath, method, route string, ...)
- func RunTest2(t *testing.T, args []string, method, route string, headers map[string]string, ...)
- func RunTest3(t *testing.T, args []string, request *TestRequest, ...)
- func RunTest4(t *testing.T, args []string, ...)
- func RunTestBase(t *testing.T, panicIfServerDidNotStart bool, ...)
- func RunTestWithArgs(t *testing.T, configurationFilePath string, args []string, ...)
- func RunTestWithArgsAndEnv(t *testing.T, args []string, method, route string, headers map[string]string, ...)
- func RunTestWithEnv(t *testing.T, configurationFilePath, method, route string, ...)
- func RunTestWithJsonConfig(t *testing.T, jsonStr string, args []string, method, route string, ...)
- func RunTestWithMultipleRequests(t *testing.T, configurationFilePath string, requests []TestRequest, ...)
- func RunTestWithNoConfigAndWithArgs(t *testing.T, args []string, method, route string, headers map[string]string, ...)
- func RunTestWithNoConfigAndWithArgsFailing(t *testing.T, args []string, method, route string, headers map[string]string, ...)
- func StatusCodeMatches(expectedStatusCode int) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func StringMatches(expected string) func(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- func TidyUpHtmlResponse(t *testing.T, response *Response, serverOutput []byte, state *E2eState)
- type E2eState
- type FsEntry
- type KillMockFunc
- type Response
- type RunMockOptions
- type TestRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ContentTypeJsonHeaders map[string]string = map[string]string{
"Content-type": "application/json",
}
View Source
var JSON_HEADER http.Header = http.Header{
"content-type": {"application/json"},
}
Functions ¶
func ApplicationOutputHasLines ¶ added in v1.0.0
func ApplicationOutputMatches ¶ added in v1.3.1
func AssertMapHasValues ¶ added in v0.2.0
func AssertMapHasValues[T_Key comparable, T_Value interface{}]( t *testing.T, subject map[T_Key]T_Value, values map[T_Key]T_Value, )
func AssertTimeDifferenceEqualOrMoreThanSeconds ¶ added in v0.3.0
func AssertTimeDifferenceLessThanSeconds ¶ added in v0.3.0
func CreateTmpEnvironment ¶ added in v1.4.5
func EnvVarExists ¶ added in v1.0.0
func GetKeys ¶ added in v0.2.0
func GetKeys[T_Key comparable, T_Value interface{}](subject map[T_Key]T_Value) []T_Key
func HeaderKeysNotIncluded ¶ added in v0.5.0
func HeadersMatch ¶ added in v0.2.0
func IndexOf ¶ added in v0.2.0
func IndexOf[T comparable](list []T, value T) int
func JsonMatches ¶ added in v0.1.0
func LineEquals ¶ added in v0.2.0
func LineRegexMatches ¶ added in v0.2.0
func MatchesFile ¶ added in v1.4.5
func MkTempNamed ¶ added in v1.4.5
func MockAssert ¶
func MockAssert(assertOptions *mocklib.AssertOptions, serverOutput *bytes.Buffer, state *E2eState) []mocklib.ValidationError
func PostMultipart ¶ added in v1.4.6
func PostUrlEncodedForm ¶ added in v1.4.6
func RemoveUntestableDataFromFileserverHtmlOutput ¶ added in v1.4.5
func RequestApiReset ¶ added in v0.1.1
func RequestApiReset(config *mocklib.MockConfig)
func RunTestBase ¶ added in v0.6.0
func RunTestWithArgs ¶ added in v0.7.0
func RunTestWithArgsAndEnv ¶ added in v1.3.0
func RunTestWithEnv ¶ added in v0.6.0
func RunTestWithJsonConfig ¶ added in v1.3.0
func RunTestWithMultipleRequests ¶ added in v0.8.0
func RunTestWithNoConfigAndWithArgs ¶ added in v0.7.0
func RunTestWithNoConfigAndWithArgsFailing ¶ added in v1.3.1
func StatusCodeMatches ¶ added in v0.2.0
func StringMatches ¶ added in v0.1.0
Types ¶
type KillMockFunc ¶
type KillMockFunc func()
func RunMockBg ¶
func RunMockBg( state *E2eState, command string, env map[string]string, panicIfServerDidNotStart bool, options *RunMockOptions, ) (KillMockFunc, *bytes.Buffer, *mocklib.MockConfig, bool)
type RunMockOptions ¶ added in v1.4.5
type RunMockOptions struct {
Wd string
}
type TestRequest ¶ added in v0.8.0
func NewGetTestRequest ¶ added in v0.8.0
func NewGetTestRequest(route string) *TestRequest
func NewPostTestRequest ¶ added in v0.8.0
func NewPostTestRequest(route string) *TestRequest
Click to show internal directories.
Click to hide internal directories.