Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct { T *testing.T DB *service.Database Server *service.Server HttpServer *httptest.Server Client service.Client }
Env provides access to all services used in tests, like the database, our server, and an HTTP client for performing HTTP requests against the test server.
func SetupEnv ¶
SetupEnv creates a new test environment, including a clean database and an instance of our HTTP service.
func (*Env) Close ¶
func (env *Env) Close()
Close must be called after each test to ensure the Env is properly destroyed.
func (*Env) ReadContactWithEmail ¶
ReadContactWithEmail reads a contact from the test database with the given email. Helpers like this make it easy to verify the state of the database as part of a test.
Click to show internal directories.
Click to hide internal directories.