Documentation ¶
Overview ¶
Package servicetest provides utilities to test services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResponseForRouteWithMockedDBAndUser ¶
func GetResponseForRouteWithMockedDBAndUser( method, path, requestBody string, user *database.User, setMockExpectationsFunc func(sqlmock.Sqlmock), setRouterFunc func(router *chi.Mux, baseService *service.Base), ) (*http.Response, sqlmock.Sqlmock, string, error)
GetResponseForRouteWithMockedDBAndUser executes a route for unit tests auth.UserIDFromContext is stubbed to return the given userID. The test should provide functions that prepare the router and the sql mock.
func WithLoggingMiddleware ¶
WithLoggingMiddleware wraps the given handler in NullLogger with hook.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.