apptest

package
v0.2019.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB       *pgx.ConnPool // db connection used throughout testing
	StdlibDB *sql.DB       // golang standard lib compatible db for 'database/sql'

)

Functions

func MustParseTime added in v0.2019.11

func MustParseTime(timestr string) time.Time

func PrepDatabase

func PrepDatabase(t testing.TB)

PrepDatabase readies the db into a clean state. This should be called before doing any interaction with the database in each test.

func Setup

func Setup(testdataPath string)

Setup should be called in TestMain, to assign the necessary globals used behind the scenes in all database-related tests (that is, db conns, loggers, and test data). After this is run, tests should call PrepDatabase() before doing work, to ensure the database state matches the test data.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL