Documentation
¶
Index ¶
- func CheckNoError(t *testing.T, err error)
- func CheckNoServerError(t *testing.T, err error)
- func CopyHeaders(from http.Header, to http.Header)
- func CreateServerCert(t *testing.T, caCert *x509.Certificate, caKey *rsa.PrivateKey, host string) tls.Certificate
- func CurrentDir(t *testing.T) string
- func FsFromMap(t *testing.T, files map[string]string) afero.Fs
- func GetFreePort(t *testing.T) int
- func GetFreePorts(t *testing.T, count int) []int
- func IsPortFree(port int) bool
- func JoinPath(base string, elem ...string) string
- func LogTest(action func(t *testing.T, output *bytes.Buffer)) func(t *testing.T)
- func MatchSnapshot(t *testing.T, values ...any)
- func NewTestClient(responseCreator RoundTripFunc) *http.Client
- func ReadBody(t *testing.T, recorder *httptest.ResponseRecorder) string
- func ReadHeader(t *testing.T, recorder *httptest.ResponseRecorder) http.Header
- func SetMuxVars(req *http.Request, vars map[string]string) *http.Request
- func SetupHTTPSTest(t *testing.T, fs afero.Fs) *http.Client
- func Times(n int, function func(n int))
- func UniqOutput(output *bytes.Buffer, action func(t *testing.T, output *bytes.Buffer)) func(t *testing.T)
- func WithTrueColor(action func(t *testing.T)) func(t *testing.T)
- type CountableHandler
- type QueueEvents
- type RoundTripFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckNoError ¶ added in v0.0.3
func CheckNoServerError ¶ added in v0.0.9
func CreateServerCert ¶ added in v0.6.1
func CreateServerCert(t *testing.T, caCert *x509.Certificate, caKey *rsa.PrivateKey, host string) tls.Certificate
func CurrentDir ¶ added in v0.3.0
func FsFromMap ¶ added in v0.0.8
FsFromMap creates afero.Fs in memory from map. Where key is a filename and value is file context.
func GetFreePort ¶ added in v0.6.1
func IsPortFree ¶ added in v0.6.1
func MatchSnapshot ¶ added in v0.6.0
MatchSnapshot matches the given value against a snapshot.
func NewTestClient ¶
func NewTestClient(responseCreator RoundTripFunc) *http.Client
func ReadBody ¶ added in v0.0.6
func ReadBody(t *testing.T, recorder *httptest.ResponseRecorder) string
func ReadHeader ¶ added in v0.0.7
func SetMuxVars ¶ added in v0.6.0
SetMuxVars sets gorilla/mux route variables for testing.
func SetupHTTPSTest ¶ added in v0.6.0
SetupHTTPSTest sets up CA for HTTPS tests and returns HTTP client with proper TLS config.
func UniqOutput ¶ added in v0.3.0
Types ¶
type CountableHandler ¶ added in v0.2.0
type CountableHandler struct {
// contains filtered or unexported fields
}
func NewCounter ¶ added in v0.2.0
func NewCounter(handler handlerFunc) *CountableHandler
func (*CountableHandler) Count ¶ added in v0.2.0
func (t *CountableHandler) Count() int
func (*CountableHandler) Reset ¶ added in v0.2.0
func (t *CountableHandler) Reset()
func (*CountableHandler) ServeHTTP ¶ added in v0.2.0
func (t *CountableHandler) ServeHTTP(writer contracts.ResponseWriter, request *contracts.Request)
type QueueEvents ¶ added in v0.6.1
type QueueEvents struct {
// contains filtered or unexported fields
}
func (*QueueEvents) List ¶ added in v0.6.1
func (q *QueueEvents) List() []string
func (*QueueEvents) Track ¶ added in v0.6.1
func (q *QueueEvents) Track(event string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.