Documentation ¶
Index ¶
Constants ¶
View Source
const DBInsertTimeTolerance = 100 * time.Millisecond
Variables ¶
View Source
var ErrTestFailure = errors.New("test failure")
View Source
var Migrations embed.FS
View Source
var MigrationsDir = "migrations"
Functions ¶
This section is empty.
Types ¶
type TestSuite ¶
type TestSuite struct { suite.Suite TestCtx context.Context //nolint:containedctx DB *sql.DB SB squirrel.StatementBuilderType // contains filtered or unexported fields }
TestSuite is a test suite that provides a Postgres instance and a DB connection. Make sure to call SetupDB() in your suite setup, and CloseDB() in your suite teardown.
func (*TestSuite) ApproxEqualTime ¶
ApproxEqualTime asserts that the two given times are within the database insert time tolerance.
func (*TestSuite) CloseDB ¶
func (s *TestSuite) CloseDB()
CloseDB closes the DB connection and terminates the Postgres instance.
func (*TestSuite) TruncateTables ¶
TruncateTables truncates the given tables.
Click to show internal directories.
Click to hide internal directories.