Documentation ¶
Overview ¶
Package tests contains supporting code for running tests.
Index ¶
Constants ¶
View Source
const ( Success = "\u2713" Failed = "\u2717" )
Success and failure markers.
Variables ¶
View Source
var ( AdminID = "32bc1165-24t2-61a7-af3e-9da4agf2h1p1" UserID = "14hg2372-66e5-34e9-jl8d-6ga1tuf7l3r4" )
Configs for running tests.
Functions ¶
func IntPointer ¶
IntPointer is a helper to get a *int from a int for helping on running tests.
func NewUnit ¶
NewUnit creates a test database. It sets the proper db migrations. It returns the logger, the database and a teardown function.
func StringPointer ¶
StringPointer is a helper to get a *string from a string for helping on running tests.
Types ¶
type Test ¶
type Test struct { TraceID string DB *sqlx.DB Log *zap.SugaredLogger Auth *auth.Auth KID string Teardown func() // contains filtered or unexported fields }
Test owns state for running and shutting down integration tests.
func NewIntegration ¶
NewIntegration creates a database, seeds it, constructs an authenticator.
Click to show internal directories.
Click to hide internal directories.