Documentation ¶
Index ¶
- func ContextWithTimeout() (context.Context, context.CancelFunc)
- func NewAPI() (*api.Server, string, routers.Router)
- func NewDatabase() *database.Database
- func ParseJSONBodyWithMap(t *testing.T, body io.ReadCloser) (map[string]interface{}, string)
- func ParseJSONBodyWithMessage(t *testing.T, body io.ReadCloser) (string, string)
- func ParseJSONBodyWithSlice(t *testing.T, body io.ReadCloser) ([]interface{}, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithTimeout ¶
func ContextWithTimeout() (context.Context, context.CancelFunc)
func NewAPI ¶
NewAPI builds a new API for testing. Makes a few assumptions about a test database and ports. Check out the code for details. Singleton, ensure your tests are able to run in parallel.
func NewDatabase ¶
func ParseJSONBodyWithMap ¶
ParseJSONBodyWithMap parses the body of a JSON response. Returns the data field as map[string]interface{} and the status message as string.
func ParseJSONBodyWithMessage ¶
ParseJSONBodyWithMessage parses the body of a JSON response. Returns the message and the status message as string.
func ParseJSONBodyWithSlice ¶
func ParseJSONBodyWithSlice(t *testing.T, body io.ReadCloser) ([]interface{}, string)
ParseJSONBodyWithSlice parses the body of a JSON response. Returns the data field as map[string]interface{} and the status message as string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.