testing

package
v0.0.0-...-cda1463 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDB

func WithDB(f func(dbtest TestDBRunner) int, reg *bsoncodec.Registry) int

WithDB will set up a test DB instance and pass it to `f` callback as `dbtest`. Once `f()` is finished, the DB will be cleaned up. Value returned from `f()` is obtained as return status of a call to WithDB(). reg is optional custom registry which can be set up for the test client.

Types

type TestDBRunner

type TestDBRunner interface {
	Client() *mongo.Client
	Wipe()
	CTX() context.Context
}

TestDBRunner exports selected calls of dbtest.DBServer API, just the ones that are useful in tests.

Jump to

Keyboard shortcuts

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