Documentation ¶
Index ¶
- func AssertAPI(t *testing.T, yamlContent, jsonContent []byte)
- func AssertHttp(t *testing.T, httpClient *http.Client, req *http.Request, ...) (*http.Response, []byte)
- func AssertQueries(t *testing.T, buf *zaptest.Buffer, lines []string)
- func AssertQueriesRegexp(t *testing.T, buf *zaptest.Buffer, lines []string)
- func GetHttpClient() *http.Client
- func GetRouter(t *testing.T) *openapi3filter.Router
- func GetTimeout(t *testing.T) time.Duration
- func LoadFile(t *testing.T, pathParts ...string) []byte
- func SaveFile(t *testing.T, content []byte, pathParts ...string)
- func SetupRepository(t *testing.T, appName, dbUser, dbPass, dbName string, logger *zap.Logger, ...) (repository.PgRepository, func(fixture ...interface{}), func())
- func SetupTestLogger() (*zap.Logger, *zaptest.Buffer)
- func ShouldUpdateGoldenFiles() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertAPI ¶ added in v0.10.0
AssertAPI compares the content of a .yml and .json formatted file, requires them to be the same
func AssertHttp ¶ added in v0.10.0
func AssertHttp(t *testing.T, httpClient *http.Client, req *http.Request, expectedStatusCode int) (*http.Response, []byte)
AssertHttp sends an HTTP request and returns an HTTP response and the body content
func AssertQueries ¶
AssertQueries asserts that the buffer contains logs for the provided queries
func AssertQueriesRegexp ¶
AssertQueries asserts that the buffer contains logs that match for the provided regular expressions
func GetHttpClient ¶ added in v0.10.0
func SetupRepository ¶
func SetupRepository(t *testing.T, appName, dbUser, dbPass, dbName string, logger *zap.Logger, fixture ...interface{}) (repository.PgRepository, func(fixture ...interface{}), func())
SetupRepository returns a new repository and a tear down function
func ShouldUpdateGoldenFiles ¶
func ShouldUpdateGoldenFiles() bool
ShouldUpdateGoldenFiles return true if golden files should be updated
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.