Documentation ¶
Index ¶
- func CreatePostgresTestContainer(ctx context.Context, dbname string) (testcontainers.Container, *sql.DB, error)
- func GetCallerPath() string
- func NewFakeUser(t *testing.T, name, email, password string, activated bool) *domain.User
- func NewPgMigrator(db *sql.DB) (*migrate.Migrate, error)
- func NewTestDB(t *testing.T) *sql.DB
- func PrepareSQLQuery(t *testing.T, db *sql.DB, filepath string) func(t *testing.T)
- func TestEndpoint(t *testing.T, router *httprouter.Router, tc APITestCase)
- type APITestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCallerPath ¶
func GetCallerPath() string
func NewFakeUser ¶
NewFakeUser creates a new fake user for testing perpose.
func NewPgMigrator ¶
func PrepareSQLQuery ¶
filepath should based on filepath from the project working directory: todos/.
func TestEndpoint ¶
func TestEndpoint(t *testing.T, router *httprouter.Router, tc APITestCase)
Endpoint tests an HTTP endpoint using the given APITestCase spec.
Types ¶
Click to show internal directories.
Click to hide internal directories.