Documentation
¶
Index ¶
- func AssertHTTPErrorCode(t *testing.T, err error, code int)
- func CreateTestContainerPostgresConnStr(t *testing.T) (string, context.Context)
- func CreateTestContainerPostgresDB(t *testing.T) (*sql.DB, string, context.Context)
- func ExecuteMiddleware(ctx echo.Context, mw echo.MiddlewareFunc) error
- func InitSession(ctx echo.Context)
- func LinkFriendsDB(ctx context.Context, db *sql.DB, profileID int, matchIDs []int) error
- func NewContext(e *echo.Echo, url string) (echo.Context, *httptest.ResponseRecorder)
- type UserRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertHTTPErrorCode ¶
AssertHTTPErrorCode asserts an HTTP status code on a given Echo HTTP error
func CreateTestContainerPostgresConnStr ¶
https://testcontainers.com/guides/getting-started-with-testcontainers-for-go/ https://golang.testcontainers.org/modules/postgres/
func CreateTestContainerPostgresDB ¶
CreateTestContainerPostgresDB returns a migration-ready DB handle for integration tests.
func ExecuteMiddleware ¶
func ExecuteMiddleware(ctx echo.Context, mw echo.MiddlewareFunc) error
ExecuteMiddleware executes a middleware function on a given Echo context
func InitSession ¶
InitSession initializes a session for a given Echo context
func LinkFriendsDB ¶
LinkFriendsDB links a profile to friend profile IDs through SQL.
func NewContext ¶
NewContext creates a new Echo context for tests using an HTTP test request and response recorder
Types ¶
type UserRecord ¶
func CreateRandomUserDB ¶
func CreateRandomUserDB(db *sql.DB) (*UserRecord, error)
CreateRandomUserDB creates a random user through SQL for DB-first tests.
func CreateUserDB ¶
func CreateUserDB(ctx context.Context, db *sql.DB, name, email, password string, verified bool) (*UserRecord, error)
CreateUserDB creates a user through SQL and returns a lightweight record.